import random

print ("number guessing game")
number = random.randint(1,9)
chances = 0
print ("Guess a number between 1 and 9!")

while chances < 5:
    guess =  int(input("Enter Your Guess: "))
    print(guess)
    
    if (guess == number):
        print("You guessed the correct number congrats!")
        break
    elif(guess < number):
        print ("Your guess was too low: Guess a number higher than",guess)
        break
    else:
        print ("Your guess was too high: Guess a number lower than",guess)
        break
    chances += 1
if not (chances < 5):
    print("YOU LOSE!!! The number is", number)

            