Advertisement
Guest User

Untitled

a guest
Dec 15th, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import json
  2. import random
  3. import sys
  4. import os
  5.  
  6. num = random.randint(0,10)
  7.  
  8. while(True):
  9. guess = int(input("Guess again:"))
  10.  
  11. if guess < num:
  12. print("Your guess is too low.")
  13. elif guess > num:
  14. print("Your guess is too high.")
  15. else:
  16. print("You got it right!")
  17. break;
  18.  
  19.  
  20.  
  21. ans = input('do you want to play again?(y/n)')
  22. if ans == "n":
  23. break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement