Python Learning
A practical Python learning path from language fundamentals upward.
- Learning resources
- 104
- Beginner
- 26
- Advanced
- 12
- Total time
- 2253 min
Start here
Python Variables and Values
Begin with the recommended resource, then continue through the learning stages in order.
Explore learning
All learning resources
Search, filter, and sort the complete learning collection for this technology.
104 resources
-
LearningpythonBeginner
Python Variables and Values
Learn how Python names values and see the program output from an editable example running in your browser.
~12 min read Open learning -
LearningpythonIntermediate
Python Objects, Values, Types, and Identity
Build the core Python data-model mental model: every value is an object with a type and identity, and learn how equality, mutability, and hashability fit together.
~22 min read Open learning -
LearningpythonBeginner
Python None and NoneType
Understand Python's None value, what NoneType means, how functions produce None, and how to test for the absence of a value.
~12 min read Open learning -
LearningpythonBeginner
Python Numbers
Learn Python's built-in number types, everyday arithmetic, and complex numbers, from division and remainders to exponentiation and rounding.
~12 min read Open learning -
LearningpythonBeginner
Python Strings
Learn Python text: quoting, f-strings, indexing and slicing, the methods worth memorizing, and the immutability that explains all the rest.
~15 min read Open learning -
LearningpythonBeginner
Python Booleans and Conditionals
Learn how Python decides: comparisons, the and/or/not trio, truthiness, and if, elif, and else branches that read like sentences.
~15 min read Open learning -
LearningpythonBeginner
Python Lists
Learn the workhorse container: creating lists, indexing and slicing them, growing and shrinking them in place, and reading them with a for loop.
~15 min read Open learning -
LearningpythonBeginner
Python Dictionaries
Learn the labeled container: storing values under keys, safe lookup with get, adding and removing entries, and walking keys, values, and pairs.
~14 min read Open learning -
LearningpythonBeginner
Python Loops
Learn repetition the Python way: for loops over sequences and range, while loops over conditions, break and continue, and enumerate for the times position matters.
~15 min read Open learning -
LearningpythonBeginner
Python Functions
Learn to give code a name: def, parameters and returns, default and keyword arguments, and the scope rules that keep functions honest.
~16 min read Open learning -
LearningpythonBeginner
Python Tuples and Sets
Learn when to use immutable tuples and unique-value sets, how packing and unpacking work, and how set operations answer membership and collection questions.
~16 min read Open learning -
LearningpythonBeginner
Python range
Learn Python's range type: half-open numeric sequences, start/stop/step, negative steps, indexing, slicing, membership, and why ranges do not materialize a list.
~12 min read Open learning -
LearningpythonBeginner
Python zip
Learn Python's zip function: parallel iteration, shortest-input behavior, strict length checking, multiple iterables, and unzipping paired data.
~12 min read Open learning -
LearningpythonIntermediate
Python Iterable Unpacking
Learn how Python assigns items from an iterable to multiple targets, including starred targets, nested patterns, and clean value swapping.
~16 min read Open learning -
LearningpythonBeginner
Python map and filter
Learn Python's map and filter built-ins for lazy transformation and selection of iterable values.
~12 min read Open learning -
LearningpythonBeginner
Python Sorting with sorted()
Learn Python's sorted() function, key functions, reverse ordering, stable sorting, and when to use list.sort() instead.
~13 min read Open learning -
LearningpythonBeginner
Python all(), any(), min(), max(), and sum()
Learn Python built-in aggregation functions for truth checks, extremes, and totals: all(), any(), min(), max(), and sum().
~16 min read Open learning -
LearningpythonBeginner
Python abs(), divmod(), and pow()
Learn three core numeric built-ins: abs() for magnitude, divmod() for quotient and remainder together, and pow() for exponentiation and modular arithmetic.
~15 min read Open learning -
LearningpythonIntermediate
Python Recursion
Learn how Python functions can call themselves, how base and recursive cases work, how values return through nested calls, and when recursion is a good fit.
~20 min read Open learning -
LearningpythonBeginner
Python Modules and Imports
Learn how Python splits programs into reusable modules, imports names safely, and uses __name__ and python -m to control how code runs.
~17 min read Open learning -
LearningpythonIntermediate
Building Command-Line Programs with argparse
Define positional arguments, options, flags, validation, help, and subcommands with Python’s argparse module.
~24 min read Open learning -
LearningpythonIntermediate
Building Iterator Pipelines with itertools
Learn to chain, limit, batch, compare, accumulate, group consecutive values, and combine iterators with itertools.
~22 min read Open learning -
LearningpythonIntermediate
Caching Function Results with functools
Learn when function-result caching is useful, how functools.cache and lru_cache reuse results, how to inspect or clear a cache, and which functions should not be cached.
~18 min read Open learning -
LearningpythonIntermediate
Command-Line Streams and Exit Status in Python
Read command-line arguments, handle standard input and output streams, and return meaningful process exit statuses with Python’s sys module.
~22 min read Open learning -
LearningpythonIntermediate
Comparing Files and Directory Trees with filecmp
Compare file contents and directory trees with filecmp, understand shallow comparisons and caching, and separate mismatches from comparison errors.
~40 min read Open learning -
LearningpythonIntermediate
Configuring Functions and Methods with functools.partial
Learn how functools.partial configures callable arguments and how functools.partialmethod creates method variants while preserving instance binding.
~16 min read Open learning -
LearningpythonIntermediate
Counting Items with collections.Counter
Use collections.Counter to tally items, rank frequent values, update counts, and compare multisets.
~17 min read Open learning -
LearningpythonIntermediate
Efficient Directory Scanning with os.scandir()
Scan directory entries efficiently with os.scandir() and DirEntry, filter types safely, manage the iterator, and understand metadata caching and errors.
~35 min read Open learning -
LearningpythonIntermediate
Environment Variables and Configuration in Python
Read optional and required environment variables, validate string configuration, parse Boolean flags, and handle sensitive settings responsibly.
~22 min read Open learning -
LearningpythonIntermediate
Grouping Data with collections.defaultdict
Use defaultdict factories to group values and initialize missing keys while understanding when lookups do and do not create entries.
~16 min read Open learning -
LearningpythonIntermediate
High-Level File Operations with shutil
Copy files and directory trees, move and remove paths carefully, inspect disk space, and work with archives using Python’s shutil module.
~30 min read Open learning -
LearningpythonIntermediate
Isolating Dependencies with unittest.mock
Isolate external collaborators with Mock, side_effect, patch, and autospec while keeping the real behavior under test.
~30 min read Open learning -
LearningpythonIntermediate
Issue and Control Warnings with Python's warnings Module
Warn callers about deprecated or questionable API use, choose warning categories, control filters, and test warning behavior.
~20 min read Open learning -
LearningpythonIntermediate
Logging Events with Python's logging Module
Record useful runtime events with named loggers, severity levels, handlers, formatters, and exception details.
~22 min read Open learning -
LearningpythonIntermediate
Managing Resources with contextlib.ExitStack
Manage optional and dynamically selected synchronous or asynchronous resources with ExitStack and AsyncExitStack, cleanup callbacks, acquisition failures, and ownership transfer.
~25 min read Open learning -
LearningpythonIntermediate
Matching Paths and Filenames with glob and fnmatch
Learn when to use glob to find pathnames and fnmatch to filter names, including recursive searches, hidden entries, case behavior, and literal wildcard characters.
~40 min read Open learning -
LearningpythonIntermediate
Python __init_subclass__ and Class Creation Hooks
Learn how Python bases can configure, validate, and register subclasses with __init_subclass__.
~20 min read Open learning -
LearningpythonAdvanced
Python __new__ and Object Creation
Understand how class calls create instances through __new__ before __init__, and learn why __new__ is especially useful for immutable-type subclasses.
~22 min read Open learning -
LearningpythonAdvanced
Python __slots__ and Instance Storage
Learn how Python __slots__ declares instance attributes, controls dynamic attributes, and changes instance storage.
~20 min read Open learning -
LearningpythonIntermediate
Python Annotations
Learn annotation syntax, annotated assignment statements, Python 3.14's deferred annotation model, and the basics of runtime annotation introspection.
~22 min read Open learning -
LearningpythonIntermediate
Python Argument Unpacking
Learn how to unpack iterables and mappings into function calls with * and **, how unpacking differs from collecting arguments, and how Python handles multiple unpackings.
~20 min read Open learning -
LearningpythonBeginnerIntermediate
Python Assert Statements
Learn how Python's assert statement checks assumptions and raises AssertionError when an expected condition is false, including when assert is appropriate and when explicit error handling is required.
~12 min read Open learning -
LearningpythonIntermediate
Python Assignment Expressions
Learn how Python assignment expressions use := to bind a name inside a larger expression, when that improves clarity, and where ordinary assignment is the better choice.
~18 min read Open learning -
LearningpythonIntermediate
Python Asynchronous Context Managers
Learn async with and asynchronous context managers through __aenter__() and __aexit__(), including awaited entry and exit, cleanup, exception handling, and multiple contexts.
~25 min read Open learning -
LearningpythonIntermediate
Python Asynchronous Generators
Learn asynchronous generator functions, yield, suspended execution, incremental production, explicit aclose(), and deterministic cleanup with contextlib.aclosing() when iteration ends early.
~25 min read Open learning -
LearningpythonBeginner
Python Augmented Assignment
Learn how +=, -=, *=, and the other augmented-assignment operators combine an operation with assignment, including their target-evaluation and in-place behavior.
~18 min read Open learning -
LearningpythonIntermediate
Python Binary Search with bisect
Find insertion boundaries in sorted sequences, search safely around duplicates, and insert values or records without re-sorting the whole list.
~15 min read Open learning -
LearningpythonBeginner
Python Bytes and Bytearray
Learn how Python represents binary data with immutable bytes and mutable bytearray objects, including indexing, slicing, construction, encoding boundaries, and common binary operations.
~20 min read Open learning -
LearningpythonAdvanced
Python Callable Objects and __call__
Learn how Python instances become callable with __call__, including state, arguments, return values, and inheritance.
~22 min read Open learning -
LearningpythonIntermediate
Python Class Methods and Static Methods
Learn how Python class methods receive the class, how static methods receive no implicit object, and how to choose between method styles.
~22 min read Open learning -
LearningpythonAdvanced
Python Class Subscription and __class_getitem__
Learn how Python classes customize square-bracket subscription with __class_getitem__, including generic-style parameterization and the boundary with instance subscription.
~24 min read Open learning -
LearningpythonBeginner
Python Classes and Objects
Learn how Python classes define objects, instance state, methods, class attributes, inheritance, and basic reuse with super().
~25 min read Open learning -
LearningpythonIntermediate
Python Comprehensions
Learn how list, set, and dictionary comprehensions build collections from iterables with concise, readable expressions.
~20 min read Open learning -
LearningpythonBeginnerIntermediate
Python Conditional Expressions
Learn how to choose between two values with Python’s conditional expression, while keeping the expression readable and distinct from a full if statement.
~12 min read Open learning -
LearningpythonIntermediate
Python Copying Objects: Shallow, Deep, and Replace
Understand assignment versus copying, shallow and deep copies of nested objects, recursive references, and copy.replace() for supported record-like objects.
~18 min read Open learning -
LearningpythonIntermediate
Python Coroutines and async/await
Understand coroutine functions, coroutine objects, and await, and learn how Python suspends and resumes coroutine execution.
~25 min read Open learning -
LearningpythonIntermediate
Python CSV
Learn how to read and write tabular CSV data with Python’s csv module.
~25 min read Open learning -
LearningpythonAdvanced
Python Custom Attribute Access
Learn how Python customizes instance attribute reads, fallback lookup, assignment, and deletion with __getattribute__, __getattr__, __setattr__, and __delattr__.
~24 min read Open learning -
LearningpythonAdvanced
Python Custom isinstance() and issubclass() Checks
Learn how Python customizes isinstance() and issubclass() through __instancecheck__() and __subclasscheck__() on a metaclass, including virtual relationships and preserving normal inheritance checks.
~25 min read Open learning -
LearningpythonAdvanced
Python Custom Subscription and Container Behavior
Learn how Python classes customize square-bracket subscription, item assignment, item deletion, reverse iteration, and formal sequence, set, and mapping interfaces.
~34 min read Open learning -
LearningpythonIntermediate
Python Dataclasses
Use dataclasses to model records with annotated fields, generated methods, safe mutable defaults, post-initialization checks, and controlled immutability.
~18 min read Open learning -
LearningpythonIntermediate
Python Decorators
Learn function decorators, wrapper behavior, functools.wraps, decorator factories and application order, plus how class decorators transform class bindings.
~28 min read Open learning -
LearningpythonIntermediate
Python del Statements
Learn how Python's del statement removes name bindings, items, slices, and attributes, and why deleting a binding is not the same as destroying an object.
~16 min read Open learning -
LearningpythonAdvanced
Python Descriptors and __set_name__
Learn how Python descriptors customize attribute access, assignment, deletion, and class-created attribute metadata.
~28 min read Open learning -
LearningpythonIntermediate
Python Double-Ended Queues with collections.deque
Use collections.deque for efficient work at both ends, FIFO queues, bounded histories, and rotation without repeating basic list operations.
~16 min read Open learning -
LearningpythonIntermediate
Python Enumerations with enum.Enum
Learn how to model a fixed set of named choices with Enum, inspect member names and values, look up and iterate over members, and prevent accidental aliases.
~15 min read Open learning -
LearningpythonIntermediate
Python Exception Groups and except*
Learn how Python groups independent exceptions and handles matching subgroups with except*.
~18 min read Open learning -
LearningpythonBeginner
Python Exceptions and Error Handling
Learn how Python reports runtime failures, handles specific exceptions, performs cleanup, raises errors deliberately, and defines custom exceptions.
~20 min read Open learning -
LearningpythonIntermediate
Python File I/O
Learn how to open, read, write, and close files safely with Python file objects.
~25 min read Open learning -
LearningpythonIntermediate
Python Format Specifications
Learn Python format specifications through format(), including width, alignment, fill, numeric precision, and reusable formatting rules without re-teaching f-strings.
~15 min read Open learning -
LearningpythonIntermediate
Python Function Parameter Kinds
Learn positional-only, keyword-only, variable positional, and variable keyword parameters and how they shape a function calling contract.
~18 min read Open learning -
LearningpythonAdvanced
Python Generator Control with send(), throw(), and close()
Learn how send(), throw(), and close() explicitly control a suspended synchronous generator, including sent values, injected exceptions, propagation, and cleanup.
~24 min read Open learning -
LearningpythonIntermediate
Python Generator Expressions
Learn how generator expressions create generator iterators, how they differ from comprehensions, and when to use them.
~20 min read Open learning -
LearningpythonIntermediate
Python Generators
Learn how generator functions and generator expressions create iterators, how yield suspends and resumes execution, and when generators are useful.
~25 min read Open learning -
LearningpythonAdvanced
Python Generic Type Parameters
Learn Python type parameter syntax for generic functions, classes, and type aliases, including type-parameter scope, bounds, defaults, and the roles of TypeVarTuple and ParamSpec.
~22 min read Open learning -
LearningpythonIntermediate
Python Iterators
Learn how Python iterables and iterators work, how for loops use the iterator protocol, how to build a simple class-based iterator, and how iter(callable, sentinel) reads until a stop value.
~25 min read Open learning -
LearningpythonIntermediate
Python JSON
Learn how to convert Python data to JSON and back, and how to save structured data in JSON files.
~25 min read Open learning -
LearningpythonIntermediate
Python Lambda Expressions
Learn how Python lambda expressions create small anonymous functions, where they fit, and when def is clearer.
~18 min read Open learning -
LearningpythonAdvanced
Python Metaclasses and Class Creation
Understand how Python creates class objects, how metaclasses control that process, and when simpler class hooks are a better choice.
~28 min read Open learning -
LearningpythonAdvanced
Python Module Attribute Access
Learn how module-level __getattr__ and __dir__ customize missing attribute lookup and module introspection without confusing attribute access with global-name resolution.
~18 min read Open learning -
LearningpythonIntermediate
Python Multiple Inheritance and Method Resolution Order
Learn how Python combines multiple base classes, resolves inherited attributes with the method resolution order, and uses super() cooperatively across a multiple-inheritance hierarchy.
~24 min read Open learning -
LearningpythonBeginner
Python Names, Scopes, and Namespaces
Understand how Python binds names, organizes namespaces, resolves names through nested scopes, and uses global and nonlocal when rebinding is intentional.
~25 min read Open learning -
LearningpythonBeginnerIntermediate
Python Operator Precedence and Evaluation Order
Learn how Python groups operators and evaluates expressions, so you can read complex expressions confidently and add parentheses when they make the meaning clearer.
~16 min read Open learning -
LearningpythonBeginner
Python Packages and Imports
Learn how Python organizes related modules into packages, how __init__.py participates in regular packages, and how absolute and relative imports connect modules.
~18 min read Open learning -
LearningpythonIntermediate
Python Paths and pathlib
Learn to build, inspect, search, compare, normalize, expand, split, and convert filesystem paths with pathlib and selected os.path APIs, including directory traversal, path identity, environment-variable expansion, drive/root/tail decomposition, path representations, home expansion, resolution, and relative paths.
~44 min read Open learning -
LearningpythonIntermediate
Python Priority Queues with heapq
Use the standard heapq module to maintain a min-heap, schedule work by priority, and understand combined push/pop operations.
~18 min read Open learning -
LearningpythonIntermediate
Python Properties and Managed Attributes
Learn how Python properties manage attributes and when functools.cached_property is useful for reusable per-instance computed values.
~26 min read Open learning -
LearningpythonIntermediate
Python Special Methods and Object Behavior
Learn how Python classes customize built-in operations with special methods such as __repr__, __str__, __format__, __len__, __bool__, __contains__, __eq__, and __add__.
~24 min read Open learning -
LearningpythonIntermediate
Python Structural Pattern Matching
Learn Python match statements through literal, capture, sequence, mapping, class, value, wildcard, guard, OR, and AS patterns.
~27 min read Open learning -
LearningpythonIntermediate
Python TOML Configuration
Learn how to read TOML configuration data with Python's tomllib module.
~25 min read Open learning -
LearningpythonIntermediate
Python Type Alias Statements
Learn Python's type statement for creating type aliases, using aliases in annotations, and understanding their lazy evaluation without confusing them with the type() function.
~15 min read Open learning -
LearningpythonIntermediate
Python Union Types with |
Learn how Python combines types with the | union expression, includes None as an allowed type, simplifies equivalent unions, and uses supported unions in runtime instance and subclass checks.
~18 min read Open learning -
LearningpythonIntermediate
Python With Statements and Context Managers
Learn Python context managers, entry and cleanup, exception propagation, multiple resources, and contextlib.suppress(), nullcontext(), and closing().
~24 min read Open learning -
LearningpythonIntermediate
Python yield from
Learn how Python's yield from delegates iteration to another iterable, how a delegated generator can return a value, and when delegation makes generator code clearer.
~22 min read Open learning -
LearningpythonIntermediate
Reading Filesystem Metadata with os.stat() and stat
Read filesystem metadata safely with os.stat(), pathlib stat methods, stat mode helpers, timestamps, and portable error handling.
~35 min read Open learning -
LearningpythonIntermediate
Regular Expressions with Python’s re Module
Learn regular-expression patterns, matching operations, capture groups, substitutions, splitting, flags, and safe limits with Python’s re module.
~30 min read Open learning -
LearningpythonIntermediate
Running External Programs with subprocess
Run child processes safely with argument lists, captured streams, exit-code handling, and timeouts using Python's subprocess module.
~24 min read Open learning -
LearningpythonIntermediate
Temporary Files and Directories in Python
Create secure scratch files and disposable workspaces with tempfile, choose an appropriate interface, and clean up reliably.
~25 min read Open learning -
LearningpythonIntermediate
Testing Asynchronous Python Code with unittest
Test coroutine-based Python code using IsolatedAsyncioTestCase, async fixtures, reliable cleanup, and await-aware dependency assertions.
~25 min read Open learning -
LearningpythonIntermediate
Testing Docstring Examples with doctest
Turn concise Python docstring and documentation examples into executable checks with doctest, testmod, testfile, expected exceptions, and unittest integration.
~30 min read Open learning -
LearningpythonIntermediate
Testing Python Code with unittest
Write focused unit tests with unittest, choose clear assertions, check expected exceptions, isolate fixtures, and discover tests from the command line.
~28 min read Open learning -
LearningpythonIntermediate
Working with Dates and Times
Use Python's datetime types for dates, clock times, durations, parsing, formatting, and timezone-aware values.
~24 min read Open learning -
LearningpythonIntermediate
Working with TAR Archives Using tarfile
Create, inspect, read, compress, and cautiously extract TAR archives with Python’s standard-library tarfile module.
~40 min read Open learning -
LearningpythonIntermediate
Working with ZIP Archives Using zipfile
Create, inspect, update, verify, and selectively extract ZIP archives with Python’s standard-library zipfile module.
~35 min read Open learning