vendredi 22 mai 2015

python- syntax error on if statement semi colon [on hold]

I'm trying to make a random number guesser game.. I'm new to coding with python and am trying out some basics. I tried to run it as a test and got a syntax error on the : in my if statement, and am unsure why. Any Ideas?

import random

goodwager = False
rightguess = random.randint(0,20)
while goodwager is False:
    guess = int(input('What number do you bet on(1 to 20)?')
    if guess == rightguess:
        goodwager = True
        print('yes!')
    else:
        print('Nope!')

Aucun commentaire:

Enregistrer un commentaire