wbreslin915

Untitled

Nov 29th, 2023
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. import random
  2.  
  3. x = (10)
  4.  
  5. number = random.randint(1,x)
  6. while number != 0:
  7.  
  8. guess = int(input(f"Guess a number between 1 and {x}: "))
  9. if guess < number:
  10. print("Sorry, too low")
  11. elif guess > number:
  12. print("Sorry, to High")
  13. elif guess == number:
  14. print(f"Good job, it was {number}")
  15. number = (0)
Advertisement
Add Comment
Please, Sign In to add comment