import random
# List of Fruits
fruits = ["apple", "banana", "cherry", "grape", "kiwi", "mango", "orange", "pear", "lemon", "strawberry", "watermelon"]
# Select a fruit from the list
secret_fruit = random.choice(fruits)
print("Welcome to the Fruit Guessing Game!")
print("I'm thinking of a fruit. Can you guess what it is?")
# Main game loop
while True:
# Get the player's guess
guess = input("Guess a fruit: ").lower()
# Check if the guess is correct
if guess == secret_fruit:
print("Congratulations! You guessed it! The fruit was", secret_fruit)
break
else:
print("Wrong guess! Try again.")
print("Thank you! The game has ended!")
Welcome to the Fruit Guessing Game! I'm thinking of a fruit. Can you guess what it is? Guess a fruit: kiwi Wrong guess! Try again.