A 21-topic Python curriculum. Each topic is a numbered folder, and inside each topic the work is split into numbered subfolders, each holding a small runnable example.
Start from 01_setup_and_basics and move down in order.
python/
├── .gitignore
├── README.md
├── example.txt
├── 01_setup_and_basics/
├── 02_variables_and_data_types/
│ ├── 01_variables_and_data_types/
│ ├── 02_type_conversion/
│ └── 03_multiple_assignment_and_constants/
├── 03_operators_and_expressions/
│ ├── 01_arithmetic_operators/
│ ├── 02_comparison_operators/
│ ├── 03_logical_operators/
│ └── 04_assignment_operators/
├── 04_conditions/
├── 05_loops/
├── 06_functions/
├── 07_data_structures/
├── 08_strings/
├── 09_modules_and_packages/
│ ├── 01_imports/
│ ├── 02_creating_modules/
│ ├── 03_packages/
│ └── 04_project_structure/
├── 10_file_handling/
├── 11_errors_and_exceptions/
├── 12_oop/
├── 13_comprehensions_iterators_generators/
├── 14_decorators_context_managers/
├── 15_testing_debugging_logging/ # has requirements.txt
├── 16_standard_library/
├── 17_environment_and_packages/
├── 18_async_and_concurrency/ # has requirements.txt
├── 19_databases/ # has requirements.txt
├── 20_web_and_api/ # has requirements.txt
└── 21_projects_and_practice/ # has requirements.txt
01_setup_and_basics— install Python, run scripts, syntax, comments, input/output02_variables_and_data_types— variables, numbers, strings, booleans, type conversion, constants03_operators_and_expressions— arithmetic, comparison, logical, assignment operators04_conditions—if,elif,else, nested conditions, logical decisions05_loops—for,while, nested loops,break,continue,pass06_functions— defining functions, arguments, return values, scope, recursion, lambda07_data_structures— lists, tuples, sets, dictionaries, nested structures, common methods08_strings— string basics, slicing, methods, formatting09_modules_and_packages—import, custom modules,__init__.py, project structure10_file_handling— reading files, writing files, CSV, JSON11_errors_and_exceptions—try,except, custom errors,finally,assert12_oop— classes, objects, methods, inheritance, polymorphism, encapsulation, magic methods13_comprehensions_iterators_generators— comprehensions, iterators, generators14_decorators_context_managers— decorators and context managers15_testing_debugging_logging—pytest, debugging,logging16_standard_library—os,pathlib,datetime,random,math17_environment_and_packages— virtual environments, pip, requirements files, package management18_async_and_concurrency—asyncio, threads, processes19_databases— SQL basics, SQLite, ORMs20_web_and_api— HTTP basics, requests, REST, JSON, Flask/FastAPI21_projects_and_practice— beginner, intermediate, advanced projects, challenges
Every topic folder has its own README.md with subfolder descriptions and the recommended run order.
Requires Python 3.10 or newer. The first topics use only the standard library — no install needed. From topic 15 onwards some examples need third-party packages.
# 1. (Recommended) Create a virtual environment
python3 -m venv .venv
source .venv/bin/activate # macOS / Linux
# .venv\Scripts\activate # Windows
# 2. Install dependencies for the topic you're on
cd 15_testing_debugging_logging && pip install -r requirements.txt && cd ..
cd 20_web_and_api && pip install -r requirements.txt && cd ..requirements.txt files live next to the topics that need them (15, 18, 19, 20, 21).
-
Open the topic's
README.mdand follow the subfolder order it suggests. -
Run a single example:
python3 path/to/folder/app.py -
Run every example in a topic (zsh/bash):
for d in NN_topic/0?_*; do python3 "$d/app.py"; done
-
Keep one concept per file when you add new examples.
-
Add more numbered folders later if you want to split a topic further.
- Topic and subfolder names use
snake_case. - Topic folders are numbered
01_…21_and are walked in that order. - Subfolders inside a topic are numbered
01_,02_, … and walked in that order. - Every script is named
app.pyso a topic can be walked with a singleforloop. - Every runnable example is executable as
python3 app.pyfrom its own folder.