Advertisement
maynul67

Game : Guss the number

Jul 19th, 2021
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. print("Guss the number! \n------------------------------------- \nEnter a number between 1-10 \nEnter q anytime to quit \n-------------------------------------")
  2. import random
  3. points = 0
  4. while True:
  5. user_input = input("Enter number :")
  6. if user_input == 'q':
  7. print("Game Over")
  8. break
  9. else:
  10. user_num = int(user_input)
  11. rand_num = random.randint(1,10)
  12. print("Random number is: ",rand_num, "\n\tTry again!")
  13. if user_num == rand_num:
  14. points = points + 10
  15. print("Congrats! \nyour point is ", points)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement