Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- guess = int(input("Pick a number between 0 and 100"))
- if guess > 100 or guess < 0:
- print ("that wasn't between 0 and 100 silly goose")
- guess = int(input("Pick a number between 0 and 100"))
- comguess = random.randint(0, 100)
- print (comguess)
- comguess1 and comguess2 = comguess
- while True:
- while True:
- resp = str(input("was I too high or too low?")
- if resp == "high" or resp == "low":
- break
- else:
- resp = str(input("only the words high or low please"))
- if resp == "high":
- comguess2 = random.randint(0, comguess1)
- print (comguess2)
- continue
- elif resp == "low":
- comguess1 = random.randint(comguess2, 100)
- print (comguess1)
- continue
- else:
- print ("finally I guessed it")
- break
- File "<ipython-input-2-0318f4cc048f>", line 14
- if resp == "high" or resp == "low":
- ^
- SyntaxError: invalid syntax
Add Comment
Please, Sign In to add comment