Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - import random
 - number = random.randint(1,10)
 - counter = 0
 - while True:
 - guess = int(input("Guess a number 1-10: "))
 - counter += 1
 - if guess > number:
 - print("Too high")
 - elif guess < number:
 - print("Too low")
 - else:
 - print("Yes! You found the number!")
 - break
 - if counter > 2:
 - print("Unlucky, you lose!")
 - break
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment