Guest User

Untitled

a guest
Oct 22nd, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. import random
  2.  
  3. guess = int(input("Pick a number between 0 and 100"))
  4. if guess > 100 or guess < 0:
  5. print ("that wasn't between 0 and 100 silly goose")
  6. guess = int(input("Pick a number between 0 and 100"))
  7.  
  8. comguess = random.randint(0, 100)
  9. print (comguess)
  10. comguess1 and comguess2 = comguess
  11. while True:
  12. while True:
  13. resp = str(input("was I too high or too low?")
  14. if resp == "high" or resp == "low":
  15. break
  16.  
  17. else:
  18. resp = str(input("only the words high or low please"))
  19. if resp == "high":
  20. comguess2 = random.randint(0, comguess1)
  21. print (comguess2)
  22. continue
  23. elif resp == "low":
  24. comguess1 = random.randint(comguess2, 100)
  25. print (comguess1)
  26. continue
  27. else:
  28. print ("finally I guessed it")
  29. break
  30.  
  31. File "<ipython-input-2-0318f4cc048f>", line 14
  32. if resp == "high" or resp == "low":
  33. ^
  34. SyntaxError: invalid syntax
Add Comment
Please, Sign In to add comment