Untitled
unknown
plain_text
2 years ago
759 B
16
Indexable
import random
def generate_random_color():
colors = ['red', 'blue', 'green', 'yellow', 'purple', 'orange']
return random.choice(colors)
def play_color_prediction_game():
target_color = generate_random_color()
print("Welcome to the Color Prediction Game!")
print("Guess the color from the following options:")
print(", ".join(['blue', 'rade', 'green', 'yellow', 'purple', 'orange']))
user_guess = input("Enter your guess: ").lower()
if user_guess == target_color:
print("Congratulations! You guessed the correct color:", target_color)
else:
print("Sorry, your guess was incorrect. The correct color was:", target_color)
if __name__ == "__main__":
play_color_prediction_game()
Editor is loading...
Leave a Comment