import random

# Define the quiz questions
quiz_questions = [
    {
        "question": "What is the capital of France?",
        "choices": ["A. Paris", "B. London", "C. Rome", "D. Madrid"],
        "correct_answer": "A"
    },
    {
        "question": "Which planet is known as the Red Planet?",
        "choices": ["A. Mars", "B. Venus", "C. Jupiter", "D. Saturn"],
        "correct_answer": "A"
    },
    {
        "question": "Who painted the Mona Lisa?",
        "choices": ["A. Leonardo da Vinci", "B. Pablo Picasso", "C. Vincent van Gogh", "D. Michelangelo"],
        "correct_answer": "A"
    }
]

# Function to randomly select questions for each game
def select_questions(num_questions):
    return random.sample(quiz_questions, num_questions)

# Function to prompt the player with each question and display choices
def ask_question(question, choices):
    print(question)
    for choice in choices:
        print(choice)
    player_answer = input("Enter your answer (A, B, C, or D): ")
    return player_answer.upper()

# Function to check if the player's answer is correct
def check_answer(question, player_answer):
    if player_answer == question["correct_answer"]:
        print("Correct!")
        return 1
    else:
        print("Incorrect!")
        return 0

# Function to play the quiz game
def play_quiz(num_questions):
    score = 0
    selected_questions = select_questions(num_questions)
    for question in selected_questions:
        player_answer = ask_question(question["question"], question["choices"])
        score += check_answer(question, player_answer)
        print()
    print("Quiz completed! Your score is:", score)

# Main program
print("Welcome to the Quiz Game!")
num_questions = int(input("How many questions would you like to answer? "))
