Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- secret_num = random.randint(1, 100)
- guess = int(input("Enter an integer from 1 to 100: "))
- while True:
- if guess < secret_num:
- print ("Too low!")
- guess = int(input("Enter an integer from 1 to 100: "))
- elif guess > secret_num:
- print ("Too high!")
- guess = int(input("Enter an integer from 1 to 100: "))
- else:
- print ("you guessed it right, well done!")
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement