Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- answer = random.randrange(21) # generates any random number from 0-20
- userinput = int(input('Guess a number from 0 to 20: ').strip())
- def verifyinput(value):
- if value == answer:
- print('Answer correct, you win!')
- correct = True
- elif value > answer:
- print('Too high, try again!')
- elif value < answer:
- print('Too low, try again!')
- verifyinput(userinput)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement