Python Exercises 🏋️
Welcome to the Python Exercises hub. This is where you move from reading code to writing it. Each phase builds on the previous one, so by the time you finish Phase 8, you'll have written everything from a simple print statement to a full data analysis pipeline.
Mentor's Note: You don't learn Python by watching — you learn by breaking things and fixing them. Every exercise here is designed to make you think, fail, and eventually succeed. 💪
🗺️ Exercise Progression
📋 Phase Overview
| # | Phase | Focus Area | Difficulty |
|---|---|---|---|
| 1 | 🚀 Getting Started | print(), REPL, comments | 🔰 Beginner |
| 2 | 🧱 Foundations | Variables, types, operators, strings | 🔰 Beginner |
| 3 | 🎮 Control Flow | if-elif-else, loops, comparisons | ⭐ Intermediate |
| 4 | 🗃️ Data Structures | Lists, tuples, dicts, sets | ⭐ Intermediate |
| 5 | 🧩 Functions & Modules | def, lambda, comprehensions, imports | ⭐ Intermediate |
| 6 | 🏛️ OOP | Classes, inheritance, encapsulation | 🏆 Advanced |
| 7 | ⚡ Advanced | File I/O, exceptions, algorithms, DB | 🏆 Advanced |
| 8 | 📊 Data Science | pandas Series, DataFrames, CSV, analysis | 🏆 Advanced |
🎯 How Exercises Work
Each exercise page contains three difficulty levels. You do not have to complete all three — pick the level that matches your confidence and available time.
🔰 Starter — "I just learned this"
- Tests a single concept from the phase
- Takes 10–15 minutes
- Starter code is almost complete — fill in the blanks
- Goal: Build confidence with the syntax
⭐ Medium — "I understand this"
- Combines 2–3 concepts from the phase
- Takes 15–25 minutes
- Starter code provides the structure — you write the logic
- Goal: Practice combining ideas
🏆 Hard — "I can build with this"
- A mini-project / portfolio piece using everything from the phase
- Takes 25–40 minutes
- Minimal starter code — you build from a specification
- Goal: Create something you can show off
💡 Tips for Success
- Type the code yourself — do not copy-paste. Muscle memory matters.
- Run the code after every 3–4 lines — catch errors early.
- Read the error message — Python tells you exactly what went wrong and where.
- Stuck for more than 10 minutes? Take a break and come back. Your subconscious will solve it.
- Modify the solution after you finish — tweak a value, change a condition, break it on purpose. That's how you learn.
🚀 Jump to a Phase
| Beginner | Intermediate | Advanced |
|---|---|---|
| Phase 1 🚀 | Phase 4 🗃️ | Phase 6 🏛️ |
| Phase 2 🧱 | Phase 5 🧩 | Phase 7 ⚡ |
| Phase 3 🎮 | Phase 8 📊 |