Intermediate Python Tutorials
Once you’re past the basics you can start digging into our intermediate-level tutorials that will teach you new Python concepts. This category is for intermediate Python developers who already know the basics of Python development and want to expand their knowledge.
If you are new to Python, we suggest you start with our Python Basics category, which takes you on a comprehensive tour through the Python language and related concepts, even if you are a complete beginner.
Free Bonus: Python Cheat Sheet
Get a Python Cheat Sheet (PDF) and learn the basics of Python 3, like working with data types, dictionaries, lists, and Python functions:
Becoming a Python expert takes time, but over time you’ll master this beautiful programming language. It’s worth it! When you’re ready to move on to more difficult topics, check out our Advanced Python Tutorials section.
Create a top-level folder with an __init__.py file, split modules by responsibility, and include pyproject.toml for metadata and build settings. Add tests in a separate tests/ folder.
A virtual environment isolates project dependencies so versions do not conflict. Create one with python -m venv .venv for every project, then activate it before installing any dependencies with pip.
Annotate functions and variables using typing and enable from __future__ import annotations on Python 3.10 or earlier. Run a checker like mypy or pyright in CI to catch mismatches.
Use the logging module, create a logger with getLogger(__name__), and set handlers and levels in one place at startup. Prefer structured logs with json format in production and avoid print() for anything beyond quick debugging.
Use pytest for unit and integration tests, fixtures for setup, and pytest-cov for coverage. Mock Input/Output and HTTP interactions with unittest.mock.