All courses

Python · 94 written lessons

Python: Beginner to Production

From your first line of code to production-ready developer

Python: Beginner to Production

Learn Python one small idea at a time, from your first line of code to a tested, packaged production project.

Start with values, decisions, and loops, then grow into functions, collections, and object-oriented design. Explore Python’s deeper tools through practical examples before bringing everything together with testing, types, concurrency, packaging, and deployment. Each lesson gives you a focused explanation, runnable examples, walkthrough notes, and something to try yourself.

What you’ll build and learn

Before you begin

No previous programming experience required. Bring a computer, a text editor, and a willingness to practice.

Start learning →

Course curriculum

Fundamentals

Your first programs: values, decisions, loops, and functions.

  1. 01Welcome and course overviewyou'll see what you'll be able to build by the end, why Python is worth learning in 2026, and how to get the most out of this course6 min read
  2. 02Prerequisites, setup, and your first programyou'll install Python 3.14 and VS Code, learn the four terminal commands you need, run your first program from a file and from the REPL, and learn how to follow along with every lesson (3.14 REPL)5 min read
  3. 03How Python code is writtenyou'll learn how statements, indentation, blocks, comments, and blank lines work, and why Python's layout rules make code easier to read6 min read
  4. 04Variables, values, and typesyou'll store values in names, inspect their types, and understand what Python does when you assign4 min read
  5. 05Numbers and arithmeticyou'll do math with ints and floats and learn where division, rounding, and floating point surprise beginners5 min read
  6. 06Strings: text, indexing, and slicingyou'll create text, pick characters and ranges out of it, and understand why strings can't be changed in place5 min read
  7. 07String methods and f-stringsyou'll clean and search text with methods and build output with f-strings, including format specs, and recognize the older % and .format() styles you'll see in existing code (3.12 nested quotes; 3.14 t-strings mentioned)6 min read
  8. 08Input and outputyou'll read what the user types, convert it to the type you need, and control how print writes to the screen5 min read
  9. 09Booleans, comparisons, and if/elif/elseyou'll compare values, combine conditions with and, or, and not, learn truthiness, and branch with if, elif, and else5 min read
  10. 10while loops, break, and continueyou'll repeat work until a condition changes and exit or skip iterations deliberately5 min read
  11. 11for loops and rangeyou'll loop over sequences and number ranges, nest loops, and use enumerate5 min read
  12. 12Loop patternsyou'll recognize and write the shapes every program repeats: accumulate, count, search with early exit, flags, nested loops, and the else clause on loops6 min read
  13. 13Listsyou'll build, index, change, and loop over lists, your first collection5 min read
  14. 14Dictionariesyou'll store key-value data, look it up safely, and loop over keys, values, and items5 min read
  15. 15Built-in functions you'll use every dayyou'll get fluent with len, range, enumerate, zip, sorted, min, max, sum, any, all, and isinstance, and learn to find the rest with help and dir5 min read
  16. 16Functionsyou'll wrap logic in a named function, call it, and understand why functions exist5 min read
  17. 17Parameters, arguments, and return valuesyou'll pass data in with positional, keyword, and default arguments, get results back with return, and understand None6 min read
  18. 18Variable arguments and unpackingyou'll accept any number of arguments with *args and **kwargs, force keyword-only and positional-only parameters, and unpack lists and dicts into calls, which is how every library you'll read is written5 min read
  19. 19Recursionyou'll write functions that call themselves, spot the base case every recursion needs, and know when a loop is the better tool6 min read
  20. 20Reading error messages and tracebacksyou'll read a traceback bottom-up, recognize the five errors beginners hit most, and fix them on purpose (3.14 improved messages)5 min read
  21. 21Project: a command-line quiz gameyou'll combine input, loops, lists, dictionaries, and functions into a small program you can keep extending6 min read

Beginner

Build useful tools with collections, files, databases, and objects.

  1. 22Lists in depthyou'll sort with single and multi-key functions and understand sort stability, slice with steps, copy correctly, and avoid the aliasing bug everyone hits once7 min read
  2. 23Tuples, unpacking, and setsyou'll use tuples for fixed records, unpack them, and use sets for uniqueness and membership tests6 min read
  3. 24Dictionaries in depthyou'll nest dictionaries, merge them, use get and setdefault, and pick dicts over lists when lookups matter6 min read
  4. 25Nested data structuresyou'll model real records as lists of dicts and dicts of lists, walk them safely, and reshape them without losing your place6 min read
  5. 26Choosing the right collectionyou'll compare list, tuple, set, and dict on ordering, mutability, lookup speed, and intent, and pick the right one on sight6 min read
  6. 27Comprehensionsyou'll build lists, sets, and dicts in one readable line, and know when a plain loop is better6 min read
  7. 28Files and pathsyou'll read and write text files safely with with, and handle paths on any OS with pathlib6 min read
  8. 29Bytes, encodings, and Unicodeyou'll understand the difference between text and bytes, encode and decode with UTF-8, and fix the mojibake and UnicodeDecodeError problems that hit every real project5 min read
  9. 30Exceptions properlyyou'll catch specific errors with try, except, else, and finally, raise your own, and design a small exception hierarchy (3.14 parenthesis-free except)7 min read
  10. 31Modules, packages, and importsyou'll split code across files, import it, control what a module exports with __all__, use relative imports inside a package, and understand the main guard, the import search path, and how circular imports happen7 min read
  11. 32Virtual environments, pip, and uvyou'll isolate a project's dependencies, install packages, and pin them in a requirements file6 min read
  12. 33The standard library touryou'll use the modules that solve everyday problems: math, random, statistics, time, os, sys, and string, and learn how to find the right module for a new problem6 min read
  13. 34Object-oriented programming: the big pictureyou'll see what objects and classes are, why programs are built from them, how everything in Python is already an object, and what the four pillars of OOP mean in practice6 min read
  14. 35Classes and objectsyou'll define a class, create instances, and give them state with the initializer and self6 min read
  15. 36Encapsulation, methods, and propertiesyou'll add behavior with methods, protect state with naming conventions and property, and share data with class attributes7 min read
  16. 37Class methods and static methodsyou'll write alternative constructors with classmethod, group helpers with staticmethod, and know when each one belongs on the class6 min read
  17. 38Inheritance and superyou'll extend a class, override methods, call super, and read a method resolution order6 min read
  18. 39Polymorphism and duck typingyou'll write code that works with any object that has the right methods, and see why Python cares about behavior rather than type6 min read
  19. 40Abstract base classes and interfacesyou'll define required methods with abc, enforce them at instantiation, and preview how Protocols do the same without inheritance7 min read
  20. 41Composition and object designyou'll compose objects instead of inheriting, keep classes small with single responsibility, and apply the handful of design rules that keep OOP code readable7 min read
  21. 42Dates and timesyou'll create, format, parse, and do arithmetic on dates with datetime, and handle time zones with zoneinfo6 min read
  22. 43JSON and CSVyou'll load and save the two data formats you'll meet everywhere, and map them to Python types6 min read
  23. 44Databases with sqlite3you'll create tables, insert and query rows with SQL from Python's built-in sqlite3, use parameters to stay safe, and know when a file of JSON stops being enough7 min read
  24. 45collections and itertools essentialsyou'll count, group, and queue with Counter, defaultdict, deque, and namedtuple, and chain iterables with itertools6 min read
  25. 46Command-line interfaces with argparseyou'll turn a script into a real command with flags, help text, and validation6 min read
  26. 47Automation: subprocess, shutil, and osyou'll run other programs, capture their output, and move, copy, and delete files from Python6 min read
  27. 48Project: a file-organizing CLIyou'll build a command that sorts a messy folder by type and date using small classes for the rules, with a dry-run flag and a log7 min read
  28. 49Idioms you'll meet in real codeyou'll read and write the ternary expression, the walrus operator, chained comparisons, star-unpacking, is versus ==, and None handling, so other people's code stops stalling you7 min read

Advanced

Write expressive, typed, tested Python with confidence.

  1. 50Iterators and the iteration protocolyou'll see what for really calls, write a class that iterates, and understand iter and next6 min read
  2. 51Generators and lazy pipelinesyou'll produce values one at a time with yield and chain generators into memory-cheap pipelines7 min read
  3. 52Scope, closures, and nonlocalyou'll follow the LEGB rule, build functions that remember state, and fix the late-binding gotcha6 min read
  4. 53Decoratorsyou'll wrap functions to add behavior, keep their identity with functools.wraps, and write decorators that take arguments6 min read
  5. 54Functional toolsyou'll use lambda, sorted keys, map and filter, and functools partial, lru_cache, and singledispatch7 min read
  6. 55Context managersyou'll write your own with-statement support using enter and exit methods and contextlib6 min read
  7. 56The data model: dunder methodsyou'll make your objects print, compare, hash, index, and add like built-ins7 min read
  8. 57dataclasses and enumsyou'll declare data-holding classes without boilerplate, freeze them, and name fixed choices with Enum7 min read
  9. 58Structural pattern matchingyou'll destructure data with match and case, including guards and class patterns (3.10+)7 min read
  10. 59Type hintsyou'll annotate functions and variables, use Optional, Union, and generics, and understand 3.14's deferred annotations7 min read
  11. 60Static checking with mypy, Protocols, and genericsyou'll run mypy, fix what it finds, and write Protocols, TypedDicts, and generic functions with the 3.12 syntax7 min read
  12. 61Regular expressionsyou'll match, extract, and replace text patterns with re, and know when not to use regex7 min read
  13. 62Loggingyou'll replace print with structured logging, set levels and handlers, and configure it once per app7 min read
  14. 63Advanced error handlingyou'll chain exceptions with raise from, print and inspect tracebacks, emit warnings, and write retry logic that gives up on purpose8 min read
  15. 64Testing with pytestyou'll write your first tests, run them, read failures, and structure a tests folder6 min read
  16. 65Fixtures and parametrizeyou'll share setup with fixtures, run one test over many inputs, and use tmp_path and capsys7 min read
  17. 66Mocking and testing side effectsyou'll isolate code from time, files, and the network with monkeypatch and unittest.mock7 min read
  18. 67Testing strategy and coverageyou'll decide what to test and what not to, arrange tests so they stay readable, measure coverage without worshipping it, and run a short test-first loop7 min read
  19. 68Debuggingyou'll stop a program with breakpoint, inspect state in pdb and VS Code, and debug systematically instead of by print7 min read
  20. 69HTTP and APIs with httpxyou'll call a JSON API, handle status codes and timeouts, and test against a local server so nothing depends on the internet9 min read
  21. 70Design patterns, the Python wayyou'll implement strategy, factory, observer, and adapter with plain functions, classes, and dicts, and see which classic patterns Python makes unnecessary8 min read
  22. 71Project: a typed, tested libraryyou'll build a small expense-report package with dataclasses, type hints, tests, and logging, ready for the Expert level9 min read

Expert

Take your code into production with concurrency, packaging, and deployment.

  1. 72Threads and the GILyou'll run I/O-bound work in threads, understand what the GIL does and doesn't protect, and see where 3.14's free-threaded build fits7 min read
  2. 73Processes and executorsyou'll use multiprocessing and concurrent.futures for CPU-bound work and choose between threads, processes, and 3.14's multiple interpreters8 min read
  3. 74async and awaityou'll write coroutines, run an event loop, and understand why await hands control back9 min read
  4. 75asyncio in practiceyou'll run tasks concurrently with TaskGroup and gather, add timeouts, write async generators and async context managers, and make async HTTP calls with httpx (3.11 ExceptionGroup)8 min read
  5. 76Algorithmic complexity in practiceyou'll build Big-O intuition by measuring how list scans, dict lookups, and nested loops grow with input size, and pick the shape of a solution before writing it8 min read
  6. 77Profiling and performanceyou'll measure before optimizing with timeit and cProfile, and apply the handful of speedups that matter8 min read
  7. 78The memory modelyou'll understand names versus objects, mutability, shallow and deep copies, reference counting, and slots8 min read
  8. 79Descriptors, metaclasses, and class creationyou'll see how property works underneath, write a descriptor, and hook class creation with init_subclass and a metaclass8 min read
  9. 80How CPython runs your codeyou'll follow a file from source to bytecode to the interpreter loop, read bytecode with dis, and understand what the __pycache__ folder is for7 min read
  10. 81Git essentials for Python projectsyou'll commit in small steps, write messages people can read, branch and merge, review a pull request the way a teammate would, and set up .gitignore so caches, venvs, and secrets never reach the repo8 min read
  11. 82Production project structure and dependency managementyou'll lay out a src package with pyproject.toml, lock dependencies with uv, and separate runtime from dev dependencies7 min read
  12. 83Packaging and publishingyou'll build a wheel, version it, and publish to TestPyPI with a console entry point8 min read
  13. 84Documenting codeyou'll write docstrings people read, keep examples honest with doctest, use type hints as documentation, and generate a docs site from them8 min read
  14. 85Configuration and secretsyou'll load settings from environment variables and TOML, keep secrets out of git, and fail fast on missing config (3.11 tomllib)8 min read
  15. 86Code quality tooling and CIyou'll enforce ruff, mypy, and tests with pre-commit locally and a GitHub Actions workflow remotely9 min read
  16. 87Deploying Python with Dockeryou'll containerize the capstone with a small Dockerfile, run it as a service with health checks and logs, and understand what changes between your laptop and production9 min read
  17. 88Security essentialsyou'll avoid the common Python security mistakes: shell injection, pickle, hard-coded secrets, weak hashing, and unpinned dependencies7 min read
  18. 89Reading real-world codebasesyou'll navigate an unfamiliar project from entry point to tests, trace a request, and read code faster than you write it9 min read
  19. 90Capstone: a production-ready packageyou'll ship the expense library as a typed, tested, packaged CLI with config, logging, CI, and a README12 min read

Closing

Choose your next direction and turn practice into lasting skills.

  1. 91What's next: choosing your pathyou'll compare web with Django and FastAPI, data, automation, scripting, and DevOps, and pick one deliberately7 min read
  2. 92How to keep practicingyou'll get project ideas for each level, a method for reading other people's code, and a way into open source7 min read
  3. 93Using what you learnedyou'll turn the course into a portfolio, a README people trust, and a first small production project for a job or a client8 min read
  4. 94Course wrap-upwe'll look back at the whole journey from print to production, and I'll say thank you5 min read