Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''Number guess'''
- '''Butom text'''
- import random
- print("I'm thinking of a number between 1-100")
- guess = int(input("Guess the number: "))
- secret = random.randint(1, 100)
- tries = 10
- if guess > secret:
- print("Too high")
- elif guess < secret:
- print("Too low")
- while tries >= 10:
- while guess != secret:
- print("You have", tries, "tries left")
- guess = int(input("Guess my number: "))
- if guess > secret:
- print("Too high")
- elif guess < secret:
- print("Too low")
- tries -= 1
- if tries >= 1:
- print("You found it")
- else:
- print("you lose")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement