mardi 27 août 2019

I get a syntax error using the python random library

I have a code that should print out a random number between 1 and 6 but i get a syntax error on line 10 on print random.randint(min, max). Where did i do wrong.

import random
min = 1
max = 6

roll_again = "yes"

while roll_again == "yes" or roll_again == "y" or roll_again == "Y":
    print ("Rolling the dices...")
    print ("The values are....")
    print random.randint(min, max)
    print random.randint(min, max)

    roll_again = raw_input("Roll the dices again?")

The error message i get when trying to run is "invalid syntax".




Aucun commentaire:

Enregistrer un commentaire