import random
# Generate a random number between 1 and 50
hidden_number = random.randint(1, 50)
print("Number Guessing Game Has started!")
print("Think a number between 1 and 50.")
# Main game loop
while True:
# Get the player's guess
guess = int(input("Make a guess: "))
# Compare the guess with the hidden number
if guess < hidden_number:
print("It is Too low!")
elif guess > hidden_number:
print("It is Too high!")
else:
print("Well done! You guessed it right!")
break
# Exit the loop when the guess is correct
print("Thank you! The game has ended!")
Number Guessing Game Has started! Think a number between 1 and 50. Make a guess: 3 It is Too low!