Thanks for helping improve this tutorial. The goal is to keep every example self-contained, runnable, and easy to learn from.
- Python 3.10 or newer
- A virtual environment is recommended
python -m venv venv
# Windows
.\venv\Scripts\activate
# macOS / Linux
source venv/bin/activate
pip install -r requirements.txt- Keep one concept per file.
- Follow the existing file header (topic, description, key concepts).
- Include short comments that explain why, not only what.
- Use modern type hints (
list[str],dict[str, int],X | None). - Prefer the standard library unless a dependency is already listed in
requirements.txt.
pytest- Put tests in
11_testing/ - Name files
test_*.pyso pytest discovers them - Cover both typical cases and edge cases
black .
isort .
mypy projects/04_weather_cli/solution.pyThese tools are listed in requirements.txt. Match the style of nearby files if you are editing an existing lesson.
- Describe what you changed and why a learner benefits
- Keep unrelated refactors out of the same PR
- Make sure CI passes
Open an issue on GitHub if you are unsure where a new example belongs.