Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
759 B
1
Indexable
Never
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()
Leave a Comment