Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- number_to_guess = random.randint(1, 101)
- boundary = 10
- guessed = 0
- while guessed == 0:
- user_input = input('Place your guess: ')
- user_input = int(user_input)
- if user_input == number_to_guess:
- print("Good job!")
- guessed = 1
- elif abs(number_to_guess - user_input) <= boundary:
- print("Close, but not close enough!")
- else:
- print("Sorry, you're nowhere close")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement