
import random

def play_game():
    number = random.randint(1, 100)
    attempts = 0

    while attempts < 5:
        guess = int(input("Choose a number from (1-100):"))

        if guess < number:
            print("Too low!")
        elif guess > number:
            print("Too high!")
        else:
            print("Congratulations,guessed the number")
            return

        attempts += 1

    print("You run out of attempts,\n The number is", number)

def play_again():
    play_again = input("Would you like to play (Yes or No) ? ")
    return play_again.lower() == "yes"

def main():
    print("Welcome to the guess the number game ")
    print("You are asked to think of a target number between 1 and 100 \nyou have 5 attempts to guess the number!")
    play_game()

    while play_again():
        print("\n-------------------\n")
        play_game()

if __name__ == "__main__":
    main()