-
This is the problem I have: Write a function roll dice that takes in 2 parameters - the number of sides of the die, and the number of dice to roll - and generates random roll values for each die rolled. Print out each roll and then return the string “That’s all!” An example output
>>>roll_dice(6,3) 4 1 6 That's all!
-
This is the code I have so far using a normal roll dice code:
import random min = 1 max = 6 roll_dice = "yes" while roll_dice == "yes": print random.randint(min,max) print random.randint(min,max) print "That's all" import sys sys.exit(0)
mercredi 1 novembre 2017
Python Roll dice with 2 parameters: Number of sides of the dice and the number of dice
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire