A simple command-line quiz game implemented in Python. The game presents trivia questions to the user and provides feedback based on their answers.
- Presents multiple-choice trivia questions.
- Tracks the user's score.
- Provides feedback on performance.
- Python 3.x
-
Clone the Repository
git clone https://github.com/yourusername/quiz-game.git cd quiz-game
-
Run the Quiz Game
Execute the main game script:
python quiz_game.py
The main script that runs the quiz game. It uses hardcoded questions and answers to quiz the user. The script includes:
- A list of trivia questions with multiple-choice answers.
- Functions to display questions, validate answers, and track the user's score.
- Feedback on the user's performance at the end of the quiz.
-
QUIZ_DATA
: A list of dictionaries where each dictionary represents a quiz question, its choices, and the correct answer. -
ask_question(question, choices, correct_answer)
: Displays a question and its choices, then checks if the user's answer is correct. -
main()
: Manages the quiz flow, keeps track of the score, and provides feedback based on the user's performance.
-
Add New Questions: To add new questions, modify the
QUIZ_DATA
list in the script. Each question is a dictionary withquestion
,choices
, andcorrect
keys. -
Change Question Format: Modify the
ask_question
function to adjust how questions and choices are presented.
When you run the script, it will prompt you with multiple-choice questions. Type the number corresponding to your answer, and after answering all questions, it will display your final score and feedback.
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by classic quiz games and educational tools.