import random

def play_game():
    random_number=random.randint(1,100)
    attempts=0
    max_attempts=3

    print("Welcome to Guess the Number game !")

    for i in range (max_attempts):
        guess_number =int (input("Enter your gusse number between 1 and 100 "))

        if guess_number==random_number:
            print("Congratulations You guessed the correct number ")
            return
        elif guess_number< random_number:
            print("Too low Try again ")

        else:  
            print("Too high Try again ")
        attempts+=1

    if attempts==max_attempts:
        print("Unfortunately , you were not able to guess the number ")

play_again = "yes"
while play_again == "yes":
    play_game()
    play_again = input("Do you want to play again ? (yes/no): ")

print("Thank you for playing!")