English · Dansk · Bahasa Melayu
Quiz Game
A console True/False quiz that asks twelve questions and shows the score.
What is it?
Day 17 of the Udemy course 100 Days of Code: The Complete Python Pro Bootcamp, the quiz project. The program builds twelve Question objects from the course data, and QuizBrain asks them one after the other with next_question, still_has_questions and check_answer. After each answer you see whether it was right, the correct answer and your score so far, and at the end your final score. The program has no runtime dependencies.
What the exercise teaches
- Writing classes with attributes and methods (
Question and QuizBrain)
- Building a list of objects from a list of dictionaries
- Looping with
while until the questions are used up
- Writing automated pytest tests, and running a linter and a strict type checker
What it does
- Twelve True/False questions from the course data
- The assignment's names
Question, QuizBrain, next_question, still_has_questions and check_answer
- Answers in any letter case; other text counts as wrong
- A running score after each answer and a final score at the end
Next