Picking up from Part 1: you've built a calculator, a contact book, and a word frequency analyzer. Part 2 levels up. The data dashboard is a real exploratory data analysis (EDA) workflow in pandas — the same shape as the first 30 minutes of every Kaggle notebook. The CLI quiz game is the most complex project in the track: three cooperating classes, a decorator for timing, and a leaderboard with JSON persistence. After that, you're ready for the capstone where you'll call your first LLM API.
Learning Objectives
After this lesson, you will be able to:
Use pandas (DataFrames, groupby, correlation) to compute and present a multi-section text dashboard
Design a CLI quiz game with three cooperating classes (Question, Quiz, Leaderboard)
Apply the decorator pattern to add cross-cutting behavior (timing) without modifying core logic
Use random.shuffle, json persistence, and OOP encapsulation in a single coherent program
Build a data analysis dashboard that loads a CSV dataset, computes summary statistics, identifies patterns, and generates a text-based report. This project simulates the kind of exploratory data analysis (EDA) that every data scientist does before building ML models.
You will work with a student performance dataset and answer questions like: What is the average score? Which subjects are hardest? Is there a correlation between study hours and grades?
Build a command-line quiz game with multiple-choice questions loaded from a data structure. The game tracks scores, provides feedback on each answer, and maintains a leaderboard. This project brings together OOP design patterns, decorators for timing, file I/O for persistence, and the random module for shuffling.
This is the most complex project in the lesson. It requires you to think about design — how to organize classes, what methods to expose, how data flows through the system.
The @timer decorator can wrap any function. Quiz logic stays focused on quiz behavior; timing is a separate, reusable wrapper. This is the same pattern FastAPI uses for route registration, Flask for view functions, and @functools.lru_cache for memoization.
Question owns the what (text, options, correct answer). Quiz owns the flow (running through questions, scoring, results). Leaderboard owns the persistence (sorting, saving, loading). None of these classes need to know much about the others' internals — they communicate through small interfaces.
generate_report is a pipeline: each section function is independent and writes to stdout. Adding a new analysis is one new function plus one line in generate_report. This is the same shape as a real ML pipeline (load → clean → engineer features → train → evaluate).
You've now shipped five working programs across Parts 1 and 2. The next lesson — Capstone: Build Your First AI Script — uses everything you've practiced (functions, OOP, file I/O, error handling, decomposition) to build a text analyzer that calls a real LLM API. Same engineering muscles, real ML payoff.
Quick Check1 / 4
In the Data Dashboard, why is each analysis function separate rather than one giant function?