Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Guss the number! \n------------------------------------- \nEnter a number between 1-10 \nEnter q anytime to quit \n-------------------------------------")
- import random
- points = 0
- while True:
- user_input = input("Enter number :")
- if user_input == 'q':
- print("Game Over")
- break
- else:
- user_num = int(user_input)
- rand_num = random.randint(1,10)
- print("Random number is: ",rand_num, "\n\tTry again!")
- if user_num == rand_num:
- points = points + 10
- print("Congrats! \nyour point is ", points)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement