Tom_Jung

Untitled

Jan 23rd, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import random
  2. number = random.randint(1,100)
  3. print(number)
  4.  
  5. def guess_game():
  6. print ("Guess a number game: make a guess between 1 and 100: ")
  7. guess = int(input("Enter your guess: "))
  8.  
  9. while guess != number:
  10.  
  11. if guess > number:
  12. print ('your guess is too high. Try again.')
  13.  
  14. elif guess < number:
  15. print ('your guess is too low. Try again.')
  16.  
  17. else:
  18. print("Bingo, that is it.")
  19.  
  20.  
  21. guess = int(input("Guess again: "))
  22.  
  23. print("Good job, you got it!")
  24.  
  25. guess_game()
Advertisement
Add Comment
Please, Sign In to add comment