Flashcard study app
Zee Hey, so. I've got the propulsion systems exam in six weeks and I learn way better by testing myself. Can you build a flashcard app? Loads cards from a file, shows me the front, I type my answer, it tells me if I got it right. And I want it to save my progress so I can pick up where I left off. Please 🙏
What you're building
Deck: python-basics.json (12 cards)
Front: What does len() return for a string?
Your answer: the number of characters
Correct!
Front: What type does input() always return?
Your answer: int
Incorrect. The answer is: str
---
Session complete: 8/12 correct.
Progress saved.What you'll need
- Classes and objects — a
Cardclass and aDeckclass give you a clean way to model the data - Files and exceptions — loading and saving the deck from a JSON file, handling a missing file on first run
- Modules and the standard library —
jsonfor file handling,randomfor shuffling - Dictionaries and lists — the underlying structure before you wrap it in classes
- Control flow — looping through the deck, branching on correct or incorrect
Hints
Start with the data, not the classes. A card is two strings: front and back. A deck is a list of cards. Get that working first, then wrap it in classes if you want the cleaner interface.
JSON handles the file format. json.load() reads a file into a Python list or dictionary. json.dump() writes it back. The json module is in the standard library.
Wrap the file load in try/except. The first time the script runs, the save file won't exist. Catching FileNotFoundError lets you start with an empty deck gracefully instead of crashing.
Going further
Once the core study loop works:
- Repeat wrong answers. Keep track of which cards the player got wrong and loop through them again at the end of the session.
- Multiple decks. List the available
.jsonfiles in a folder and let the user choose which deck to study. - Spaced repetition. Record how many times each card was answered correctly. Show cards answered correctly less often more frequently.

