This is a semi-comprehensive, practical-based learning segment for grasping general programming concepts using the Python Programming Language
Programming is an extremely powerful tool, it enables the modern world to function fast and efficient. It is the backbone of any device, application. It powers the banking industry, stock markets, cars, phones and so on. Understanding it is key to unlocking the future.
Python was created during a time when everything was hard to build, most notable software was written in C and it was / still is, a nightmare to do properly. When Python was introduced, it was somewhat revolutionary because of the freedom it gave people, the english-like syntax and of course, the garbage collector. Not having to worry about freeing ram was a game changer at the time.
Fast foward to 2026, Python powers the entire Machine Learning Pipelines, AI Models, Research and more. Of course, Python is slow compared to other languages, but it is fast enough as most of the libraries you get to use in Python, are written in faster languages. This enables a balance between performance, safety and fast protyping. Perfect to analyzing data, producting MVPs and leveraging already written tools to speed up your workflow.
This guide is a set of exercises, explanations and practical approaches to ensure a somewhat deeper understanding about the language. Learning should be fun, not boring. The only way to have fun is to translate these ideas into something palpable.
You need Python 3.12 or newer. Check with python --version.
# 1. create an isolated environment for this project
python -m venv .venv
# 2. activate it
.venv\Scripts\activate # Windows (PowerShell / cmd)
source .venv/bin/activate # macOS / Linux
# 3. install the four tools this course uses
pip install -r requirements.txt
# 4. see what you are in for
python check.py --listThen start:
python check.py 01It will tell you exactly what is broken. Open the module's exercise.py, fix
one function, run it again.
exercises/07_csv_parsing/
├── README.md what you are building, and why it matters
├── notes/ the mental model, in short numbered pieces
│ ├── 01_what_a_csv_really_is.md
│ ├── 02_why_split_comma_breaks.md
│ ├── 03_the_csv_module.md
│ └── 04_dirty_data_in_the_wild.md
├── data/ self-contained sample files
├── exercise.py <- the only file you edit
└── test_exercise.py the precise specification. Read it.
The loop is always the same:
- Read the module
README.md. - Read the
notes/in order. They are short and they are the actual teaching. - Open
exercise.pyand replace eachraise NotImplementedErrorwith real code. python check.py 07until it is green.python check.py --types 07to check your annotations are honest.- Compare with
solutions/07_csv_parsing/exercise.py— the comments explain why, not what.
check.py shows one failing check at a time, on purpose. A wall of twenty
tracebacks teaches nothing; one is a to-do list.
python check.py # every module
python check.py 7 # just module 07
python check.py csv # match by name instead
python check.py 7 --all # show every failure, not just the first
python check.py 7 -v # full pytest output
python check.py --types 7 # run mypy on your annotations
python check.py --list # the curriculum
python check.py --solutions # prove the reference solutions passEach module builds on the last. Do them in order.
| # | Module | What you take away |
|---|---|---|
| 01 | Variables and types | Names, numbers, text, and writing down what shape your data is |
| 02 | Functions and typing | Reusable pieces, and float | None — the type of "missing" |
| 03 | Lists and tuples | Slicing, sorting with keys, and when position carries meaning |
| 04 | Dictionaries and sets | Counting, grouping, deduplicating — the shape of GROUP BY |
| 05 | Control flow and comprehensions | Branching, looping, and the Python way to transform a list |
| # | Module | What you take away |
|---|---|---|
| 06 | Files and paths | pathlib, encodings, and why with is not optional |
| 07 | Parsing CSV | Why split(",") breaks, and the cleaner every pipeline needs |
| 08 | Classes and dataclasses | Modelling a record so its rules travel with it |
| 09 | Errors and validation | Fail fast vs collect-and-continue — and never dropping a row silently |
| 10 | Typing, properly | Literal, TypedDict, Protocol, generics, narrowing |
| # | Module | What you take away |
|---|---|---|
| 11 | JSON and nested data | APIs, JSON Lines, and digging safely through structure |
| 12 | Generators and lazy pipelines | Processing more data than fits in memory |
| 13 | Building a CLI tool | argparse, stdout vs stderr, exit codes, a testable main |
| 14 | Scraping web pages | BeautifulSoup, relative URLs, and scraping responsibly |
| 15 | Capstone — a real ETL pipeline | All of it at once, on data that fights back |
Everything here circles the same three points. If you take nothing else:
1. Convert at the edge. Data arrives untyped — CSV gives you strings, JSON
gives you Any, HTML gives you tag soup. Turn it into your own types
immediately, in one place, and refuse what will not convert. After that
boundary, everything downstream is real.
2. Write down the shape. A type annotation is a promise that tooling can
check and that cannot drift out of date. list[Sale] tells the next reader
more than a paragraph, and mypy finds the missing-value bug in half a second
instead of at 3am.
3. Never silently drop a row. Count what you rejected, name it, report it, and refuse to publish when too much of the input was unusable. This is the difference between a script and a pipeline.
- Read the failing test. It is the exact specification.
print(repr(value))—reprshows the invisible characters that break comparisons.- Run
python check.py --types NN; a type error often is the bug. - The answer is in
solutions/. Looking is fine — read the comments, then close it and write your own version.
Written for Python 3.12+ and tested on 3.14. Every exercise starts with
from __future__ import annotations, so the modern list[str] and X | None
syntax works throughout.