A GUI application that guides you through all 42 Python programming exercises from "Python Programming Exercises, Gently Explained" by Al Sweigart.
- Python 3.8+
- customtkinter library
pip install customtkinterpython main.pyYou can package the app into a standalone executable that doesn't require Python to be installed on the target machine.
-
Install PyInstaller:
pip install pyinstaller
-
Run the included build script:
python build.py
(To remove previous build artifacts before building, run
python build.py --clean)
The final executable will be generated in the dist/ folder.
- 42 exercises from beginner to intermediate level
- Code editor with 4-space tab support
- Run button — executes your code and shows output
- Submit button — validates your solution against test cases
- Progressive unlocking — complete an exercise to unlock the next
- Hint system — shows a partial hint when you're stuck
- Reference solutions — view Al Sweigart's solution after you complete an exercise
- Auto-saves your code between sessions (stored in
~/.python_exercises/) - Progress tracking — picks up where you left off
- Read the exercise description on the left panel
- Check the expected output / validation rules below the description
- Write your Python code in the right editor, using the SOLUTION CODE and TESTING CODE sections appropriately.
- Click ▶ Run to test your code and see output (runs both sections)
- Click ✓ Submit to validate your solution (validates only the solution section)
- If it passes, the next exercise unlocks automatically!
- After completing an exercise, click 🔑 Solution to compare with the book's solution
For more detailed instructions, please read the USER-GUIDE.md.
Exercises 1–42 covering: print/input, functions, math operators, modulo, loops, file I/O, lists, dictionaries, strings, random numbers, sorting algorithms, and more.
- Your solutions are saved to
my_solutions/inside the app folder - Progress is saved to
progress.jsoninside the app folder - The app runs your code in a subprocess with a 10-second timeout
- For programs that use
input(), type your input in the ⌨️ Program Input box before clicking ▶ Run
This app uses PEP 8 snake_case for all function and variable names (e.g. fizz_buzz, is_leap_year), which is the official Python style guide standard.
Al Sweigart's original book uses camelCase (e.g. fizzBuzz, isLeapYear). If you reference the book alongside this app, the function names will differ slightly — but the logic is identical. Learning snake_case from the start is a good habit for writing professional Python code.
