This question already has an answer here:
So, I made a dice rolling program in Python 3.6 and something weird is happening. The code below should work but it shows "random" in "random.randint" as a syntax error. Not sure why. Help. (Random module has been imported at the top of my code.)
def dice():
min = 1
max = 6
print("Dice roller rolls 2 dice numbers 1-6.")
time.sleep(1)
print("Would you like to roll? (y/n)")
start = input()
if start == "y":
print("Rolling dice...")
time.sleep(1.5)
print("Your numbers are: ")
print random.randint(min, max)
Aucun commentaire:
Enregistrer un commentaire