Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Can you crack the secret
- attempt = 0
- guess = 0
- import random
- secret = random.randint(1,20)
- print('Guess a number that lies from 1 to 20, within 5 attempts, or face the number demons!!')
- while (guess !=secret) and (attempt <5)
- attempt = attempt +1
- elif tries >1 and guess <secret:
- print('Sorry your guess was too low, try again')
- elif tries >1 and guess >secret:
- print('Sorry your guess was too high, try again')
- guess = int(input ('What is your Number', attempt, 'guess?')
- if guess == secret:
- print ('Well done the number demons won't be visiting you!!')
- if guess!=secret:
- print ('Sorry your luck has run out')
- print ('If you had input',secret, 'then the number demons would not be visiting you!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement