Backend & Data Science ยท Free course

Python Course Notes

Complete Python course: setup with uv, core syntax, data structures, functions, OOP, packaging, exceptions and logging, files, generators and decorators, type hints and Pydantic, asyncio, pytest, FastAPI, NumPy and pandas.

  • 15Lectures
  • 16+ hrsReading time
  • 270Topics covered
Course syllabus

15 lectures, start to finish

Each lecture has detailed notes, code examples, interview questions and practice exercises. Follow them in order, or jump to the topic you need.

Lecture 1

Introduction to Python, Installation & Your First Program

Learn what Python is, where it is used (web, data science, AI, automation), how interpreted CPython runs code, and how to install Python on Windows, macOS and Linux. Set up VS Code, use the REPL, write your first script, master indentation, print(), input(), venv and uv, and the Zen of Python.

  • 65 min read
  • 18 topics
  • Beginner
Lecture 2

Variables, Data Types, Operators & Strings

Learn Python variables and dynamic typing, core data types (int, float, bool, None), type conversion, arithmetic, comparison and logical operators, is vs ==, and Python strings: indexing, slicing, string methods, f-strings and format specifiers, escape sequences, raw strings and immutability.

  • 60 min read
  • 18 topics
  • Beginner
Lecture 3

Control Flow โ€” Conditionals, match, Loops & Comprehensions

Master Python control flow: if/elif/else, truthiness, conditional expressions, match/case pattern matching, for loops and range, while, break/continue/else, enumerate and zip, list/dict/set comprehensions and the walrus operator โ€” with real examples, common mistakes and interview questions.

  • 50 min read
  • 18 topics
  • Beginner
Lecture 4

Functions โ€” Parameters, Scope, Lambdas & Closures

Master Python functions: def and return, default parameters and the mutable default trap, *args and **kwargs, keyword-only and positional-only parameters, docstrings, the LEGB scope rule, global and nonlocal, first-class functions, lambda, map, filter, sorted with key, closures and recursion.

  • 60 min read
  • 18 topics
  • Beginner
Lecture 5

Data Structures โ€” Lists, Tuples, Dictionaries, Sets & collections

Master Python data structures: lists and list methods, shallow vs deep copy, tuples and unpacking, dictionaries and dict ordering, sets and set operations, time complexity basics, and the collections module (Counter, defaultdict, deque, namedtuple) plus heapq and bisect with real examples.

  • 60 min read
  • 18 topics
  • Beginner
Lecture 6

Object-Oriented Programming in Python

Master object-oriented programming in Python: classes and objects, __init__ and self, instance vs class attributes, @classmethod and @staticmethod, inheritance, super() and MRO, dunder methods, @property, encapsulation, abstract base classes, composition and dataclasses, with runnable examples.

  • 65 min read
  • 18 topics
  • Intermediate
Lecture 7

Modules, Packages, Dependencies & Project Structure

Master Python modules and the import system, if __name__ == "__main__", packages and __init__.py, relative vs absolute imports, the standard library, pip and PyPI, virtual environments, requirements.txt, pyproject.toml, uv lockfiles, the src layout and publishing a package to PyPI.

  • 75 min read
  • 18 topics
  • Intermediate
Lecture 8

Errors, Exceptions, Debugging & Logging

Master Python exception handling: try/except/else/finally, catching specific exceptions, raise from, custom exception classes, ExceptionGroup and except*, assertions, debugging with breakpoint(), pdb and VS Code, and the logging module with levels, handlers and formatters.

  • 70 min read
  • 18 topics
  • Intermediate
Lecture 9

Working with Files, JSON, CSV & pathlib

Learn modern Python file handling: open() with context managers, text vs binary modes, UTF-8 encoding, reading and writing line by line, pathlib.Path, glob, os and shutil, JSON with json.load and json.dump, CSV with DictReader and DictWriter, .env files and processing large files efficiently.

  • 55 min read
  • 18 topics
  • Intermediate
Lecture 10

Iterators, Generators, Decorators & Context Managers

Learn Python iterators and the iteration protocol (__iter__, __next__), generators and yield, generator expressions and lazy evaluation, itertools, decorators with arguments and functools.wraps, lru_cache and cache, and context managers with __enter__/__exit__ and contextlib.

  • 55 min read
  • 18 topics
  • Intermediate
Lecture 11

Type Hints, Dataclasses, Pydantic & Writing Clean Python

Learn Python type hints and annotations, built-in generics like list[int], Optional and union with |, TypedDict, Protocol, PEP 695 generics, mypy and pyright, dataclasses (frozen, field, slots), Pydantic v2 validation, PEP 8 and ruff, and how to write clean, idiomatic Python.

  • 70 min read
  • 18 topics
  • Intermediate
Lecture 12

Asynchronous Python โ€” asyncio & Concurrency

Master asynchronous Python: concurrency vs parallelism, the GIL and free-threaded builds, threading vs multiprocessing vs asyncio, async/await, the event loop, gather, TaskGroup, timeouts, async HTTP with httpx, concurrent.futures and choosing the right model for I/O-bound vs CPU-bound work.

  • 65 min read
  • 18 topics
  • Advanced
Lecture 13

Testing with pytest

Learn Python testing with pytest from scratch: test discovery, assertion introspection, fixtures and scopes, parametrize, pytest.raises, monkeypatch and unittest.mock, tmp_path, coverage with pytest-cov, testing async code, the TDD workflow and CI with GitHub Actions.

  • 65 min read
  • 18 topics
  • Intermediate
Lecture 14

Building REST APIs with FastAPI

Learn to build production-ready REST APIs with FastAPI and Pydantic v2: path and query parameters, request and response models, HTTPException, dependency injection with Depends, async endpoints, SQLModel databases, OAuth2 JWT authentication, CORS for React/Next.js, TestClient tests and deployment.

  • 65 min read
  • 18 topics
  • Advanced
Lecture 15

Data Analysis with NumPy & pandas, Automation & Course Wrap-Up

Learn data analysis in Python with NumPy arrays, vectorization and broadcasting, pandas Series and DataFrame, reading CSV and Excel, loc/iloc selection, filtering, groupby, merge, missing data and matplotlib charts, then build automation scripts with pathlib, httpx, scheduling and argparse CLIs.

  • 54 min read
  • 18 topics
  • Advanced

Ready to build something?

Put the notes into practice with free UI templates and full-website AI prompts you can copy.

Browse templates