# -*- coding: utf-8 -*-
"""Khalid AlHarbi Simple Quiz Game (No GUI)

Automatically generated by Colaboratory.

Original file is located at
    https://colab.research.google.com/drive/11mgGNj2iu_ZzRisuLf3SrUemixYNpKgf
"""

import random

# Define the quiz questions and answers
questions = {
    "What is the capital of France?": ["A. Paris", "B. London", "C. Rome", "D. Berlin"],
    "Which planet is known as the Red Planet?": ["A. Mars", "B. Jupiter", "C. Saturn", "D. Earth"],
    "What is 2 + 2?": ["A. 3", "B. 4", "C. 5", "D. 6"],
    "What is the largest mammal?": ["A. Elephant", "B. Blue Whale", "C. Giraffe", "D. Lion"]
}

# Define a function to ask questions and evaluate answers
def ask_question(question, choices):
    print(question)
    for choice in choices:
        print(choice)
    answer = input("Enter your choice (A/B/C/D): ").upper()
    return answer

# Define a function to run the quiz game
def run_quiz(questions, num_questions):
    # Shuffle the questions
    shuffled_questions = list(questions.items())
    random.shuffle(shuffled_questions)

    score = 0
    for i in range(num_questions):
        question, choices = shuffled_questions[i]
        answer = ask_question(question, choices)
        correct_answer = choices[0][0]
        if answer == correct_answer:
            print("Correct!")
            score += 1
        else:
            print("Incorrect!")
            print("The correct answer is:", correct_answer)

    print("Quiz completed!")
    print("Your score is:", score, "/", num_questions)

# Run the quiz game with 3 questions
run_quiz(questions, 3)