Small, runnable practice exercises for new Python programmers β each with a built-in self-check and a worked solution.
These exercises mirror the learning track on pythonbeginner.help. Read a topic, then practice it here.
-
Make sure you have Python installed (3.8+).
-
Open an exercise in the
exercises/folder and complete theTODO. -
Run it β each file checks your answer with
assertand prints β when it passes:python exercises/01_variables.py
-
Stuck? Compare with the matching file in
solutions/.
| # | Exercise | Topic | Tutorial |
|---|---|---|---|
| 01 | Variables & types | Variables, int/str |
Learn β |
| 02 | String methods | Strings, slicing | Learn β |
| 03 | Lists | Lists, indexing | Learn β |
| 04 | Loops | for / range |
Learn β |
| 05 | Functions | def, return values |
Learn β |
for f in exercises/*.py; do echo "== $f =="; python "$f"; done- π Tutorials: pythonbeginner.help
- π Python Cheatsheet
- π§ Python Error Fixes β when an exercise throws an error you don't recognise.
Released under CC0 1.0 by pythonbeginner.help β copy, remix, and teach with these freely.