Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- num = random.randint(1,100)
- userinp = int(input("Enter a number between 1 and 100: "))
- br = 1;
- while userinp != num:
- br=br+1
- if userinp > num:
- print("Too big")
- elif userinp < num:
- print("Too small")
- userinp = int(input("Enter a number between 1 and 100: "))
- print("You guessed it! The number was", num)
- print("It took you " , br , " tries!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement