Capstone: Flashcard Quiz App
This is your capstone: a small flashcard quiz app that brings together almost everything in the course. It stores questions and answers in a dictionary, checks each answer with a function, loops through every card, and tracks a score. If you can build this, you can build real Python programs.
What You'll Build
- Flashcardsdict of Q -> A
- Check each answerfunction
- Loop all cardsscore
- Final score
Every skill from the course appears here:
- Dictionaries hold the flashcards and the answers
- A function checks whether an answer is correct
- A loop goes through every card
- Conditionals and string methods compare answers fairly
- An accumulator tracks the score
Step 1: Store the Flashcards
Each card is a key (the question) and a value (the correct answer):
Step 2: A Function to Check Answers
The checker forgives capitalization and stray spaces by using strip() and lower(). It returns 1 for a correct answer and 0 otherwise, so scoring is just addition:
Step 3: Loop and Score
Loop over every flashcard, look up the player's answer, and add the checker's result to the score.
Build It Yourself
Using the flashcards and answers below, reproduce the exact four lines of output.
Make It Your Own
Swap in your own flashcards, or turn it into a percentage:
Challenge Ideas
- Shuffle the cards each round with
random.shuffle - Keep only the cards the player got wrong for a second pass
- Add a category to each card and score by category
You Did It
You just combined dictionaries, functions, loops, conditionals, and string methods into a working app. That is the same toolkit behind quiz sites, form validators, and countless real programs.
Finish the final exam to earn your free certificate, then keep building. Every idea in this course grows into bigger projects from here.
Key Takeaways
- Real programs combine data structures, functions, loops, and conditionals
- Store related data in dictionaries and process it with a loop
- A small function with a clear return value keeps logic reusable
- Normalizing text with
strip().lower()makes comparisons fair - You now have the foundation to build your own Python projects

