Python in 30 Days
A thirty-day path through Python. Each day is short enough to finish in one sitting and ends with something you can run yourself.
Lessons in order
- 01Beginner 12 min
Day 1 — Python Basics
Install Python, run your first program, understand what the interpreter actually does, and learn how to read an error message without panicking.
- 02Beginner 14 min
Day 2 — Variables and Data Types
What a variable really is, the core Python types, why 0.1 + 0.2 is not 0.3, and how to convert between types without breaking things.
- 03Beginner 14 min
Day 3 — Strings
Work with text in Python: indexing, slicing, the string methods you will actually use, and why strings cannot be changed in place.
- 04Beginner 14 min
Day 4 — Lists
Lists are the workhorse of Python. Learn how to build them, change them, slice them, sort them, and avoid the copy trap that bites beginners.
- 05Beginner 13 min
Day 5 — Tuples and Sets
Tuples for fixed groups of values, sets for uniqueness and fast membership checks. Learn the trade-offs and when each beats a list.
- 06Beginner 14 min
Day 6 — Dictionaries
Store data by name instead of position. Learn dictionary lookups, safe access with get, looping over items, and nesting for real-world records.
- 07Beginner 12 min
Day 7 — Conditions
Make decisions in code with if, elif and else. Understand comparison operators, and/or/not, truthiness, and why deep nesting is worth avoiding.
- 08Beginner 13 min
Day 8 — Loops
Repeat work without repeating yourself. Learn for loops over collections, while loops for unknown counts, and the helpers that keep loops readable.
- 09Beginner 15 min
Day 9 — Functions
Package logic into reusable functions. Learn parameters, return values, default arguments, scope, and the mutable default trap.
- 10Beginner 13 min
Day 10 — Modules and Packages
Split code across files, import what you need, understand packages and __init__.py, and learn why the if __name__ == "__main__" line exists.
- 11Beginner 14 min
Day 11 — Exception Handling
Handle failure without hiding it. Learn try/except/else/finally, catching the right exception, and when letting an error crash is the correct choice.
- 12Beginner 14 min
Day 12 — File Handling
Read and write files without leaking handles or loading gigabytes into memory. Covers with statements, modes, encodings, CSV and pathlib.
- 13Beginner 12 min
Day 13 — Comprehensions
Turn a three-line loop into one readable line. Learn list, dict and set comprehensions, filtering, and when a plain loop is still better.
- 14Beginner 12 min
Day 14 — Lambda, map and filter
Small anonymous functions and where they genuinely help: sorting by a field, mapping values, and why comprehensions usually read better.
- 15Beginner 12 min
Day 15 — OOP Basics
Understand what problem classes solve before learning the syntax: grouping data with the behaviour that belongs to it, and when functions are enough.
- 16Beginner 14 min
Day 16 — Classes and Objects
Write real classes: instance versus class attributes, instance methods, class methods, static methods, and keeping objects valid from the start.
- 17Intermediate 14 min
Day 17 — Inheritance
Share behaviour between related classes with inheritance, call the parent with super(), override methods safely, and know when composition is better.
- 18Intermediate 13 min
Day 18 — Polymorphism and Encapsulation
One call, many behaviours: how duck typing works in Python, and how to hide internal state so objects stay valid as your code grows.
- 19Intermediate 14 min
Day 19 — Iterators and Generators
Produce values one at a time instead of building giant lists. Learn how for loops really work, what yield does, and when generators save your memory.
- 20Intermediate 15 min
Day 20 — Decorators
Add timing, logging, caching or auth checks around a function without editing it. Learn how decorators work and how to write one correctly.
- 21Beginner 13 min
Day 21 — Virtual Environment and pip
Keep each project’s packages separate with venv, install with pip, pin versions in requirements.txt, and stop "works on my machine" problems.
- 22Intermediate 14 min
Day 22 — Type Hints and Dataclasses
Say what your functions expect and return, catch mistakes before running, and replace boilerplate classes with dataclasses.
- 23Intermediate 15 min
Day 23 — Testing
Write tests that catch real bugs: pytest basics, arrange-act-assert, fixtures, testing failure cases, and what not to test.
- 24Intermediate 15 min
Day 24 — Working with APIs
Call a web API from Python properly: status codes, timeouts, retries, authentication headers, and handling failure without crashing.
- 25Beginner 13 min
Day 25 — JSON and HTTP
Understand the request and response cycle, common status codes and methods, and how JSON converts between Python objects and text.
- 26Intermediate 15 min
Day 26 — SQLite
Store data properly using the database built into Python. Tables, inserts, queries, parameters that block SQL injection, and transactions.
- 27Intermediate 16 min
Day 27 — Flask/FastAPI Basics
Turn your Python functions into a web API: routes, path and query parameters, request bodies, validation and correct status codes.
- 28Intermediate 13 min
Day 28 — Python Project Structure
Lay out a project so it stays understandable: source layout, config, tests, environment variables and the files every repository should have.
- 29Intermediate 20 min
Day 29 — Mini Project
Put the last four weeks together: a command-line expense tracker with SQLite storage, validation, tests and a clean structure.
- 30Intermediate 16 min
Day 30 — Final Project and Best Practices
Ship a complete project and adopt the habits that separate working code from maintainable code — plus a clear path for what to learn next.