Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def guessing_game():
- while True:
- number = random.randint(1,10)
- x = (input("Enter a number from 1-10 or enter the word 'pass': "))
- if x == 'pass' or x == 'Pass':
- continue
- elif x == "":
- break
- elif int(x) == number:
- print('Congratulations! You guessed it!')
- elif int(x) != number:
- print(f'You got it wrong. The number was {number}')
- print("Game Over")
- guessing_game()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement