# Import the random module to generate random numbers
import random
# Block for player name input
# Ask the player for their name and store it in a variable
player_name = input("Please enter your name: ")
# Block for welcome message
# Use the player's name to print a welcome message
print(f"Welcome to the Guess the Number game, {player_name}!")
# Block for generating a random number
# Generate a random number between 1 and 10 (inclusive) and store it in a variable
secret_number = random.randint(1, 10)
# Block for player's guess
# Ask the player to guess the number and store their guess in a variable
player_guess = int(input("Guess the number I'm thinking of (between 1 and 10): "))
# Block for checking the player's guess and providing feedback
# Use nested if statements to check if the player's guess is too high, too low, or correct
if player_guess == secret_number:
print("Correct! You guessed the number!")
elif player_guess > secret_number:
print("Too High. The guess was higher than the number.")
else:
# This else block is reached only if the guess is not equal and not higher, so it must be lower
print("Too Low. The guess was lower than the number.")
# Block for ending the game
# Thank the player for playing and display a game over message
print(f"Thank you for playing, {player_name}! Game Over.")