Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- secret = random.randint(1,20)
- ##print('secret ',secret)
- guess = 0
- tries = 0
- print('Try to guess a number between 1 and 20, using the four clues if you need them.')
- print('You have 5 guesses.')
- while (guess != secret) and (tries < 5):
- guess = int(input('What is your guess? '))
- tries = tries + 1
- if guess == secret:
- print('You got it')
- if guess != secret:
- print ('Wrong, sorry, you have used up your five guesses. Better luck next time.')
- print ('The secret number was', secret)
Add Comment
Please, Sign In to add comment