Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. from random import randrange
  2. rand_num = randrange(0, 101)
  3. print(rand_num)
  4. counter = 1
  5. while counter < 7 :
  6. user_input = input("Guess a number between 1 and 100: ")
  7. if int(user_input) < rand_num:
  8. print("the number you guessed is lower than the acutual number")
  9. elif int(user_input) >rand_num:
  10. print("the number you guessed is higher than the acutual number")
  11. else:
  12. print("you guessed it in ", counter, "tries, congrats!.")
  13. break
  14. counter = counter +1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement