Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randrange
- rand_num = randrange(0, 101)
- print(rand_num)
- counter = 1
- while counter < 7 :
- user_input = input("Guess a number between 1 and 100: ")
- if int(user_input) < rand_num:
- print("the number you guessed is lower than the acutual number")
- elif int(user_input) >rand_num:
- print("the number you guessed is higher than the acutual number")
- else:
- print("you guessed it in ", counter, "tries, congrats!.")
- break
- counter = counter +1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement