Pages

Topics

Tools

↑↓navigate↵openescclose

Python guides

Every published Python guide, newest first, with practical examples you can copy into your own project.

3,965 guides across 14 topics

Topics

Latest Python guides

Illustration of a Python tuple as an immutable ordered container with type annotations, shown as a row of locked boxes.
Python

Python Tuple Type: Immutable Sequences Explained

Learn how the Python tuple type works: construction, type annotations, unpacking, named tuples, and when to choose tuples over lists for memory efficiency.

Pythontupletype hintsimmutable
Illustration of a Python list as an ordered mutable sequence of mixed-type elements with type annotation brackets.
Python

Python List Type: Behavior, Annotations, and Performance

python list type: Understand Python's list type: runtime behavior, type annotations, common operations, performance tradeoffs, and compatibility considerations for mod...

Pythonlisttype annotationssequences
A bytearray visualized as a mutable sequence of bytes with an edit pencil, representing in-place binary data modification.
Python

Python bytearray Type: Mutable Binary Data

python bytearray type: Learn how to use Python's bytearray type for mutable binary data: creation, mutation, conversions, performance, and common pitfalls.

bytearrayPythonmutable bytesbinary data
Python bytes type concept with binary data and encoding arrows
Python

Python Bytes Type: Binary Data Handling

python bytes type: Learn how to create, manipulate, and convert Python bytes objects for binary data handling, with practical examples and performance considerations.

bytesbinary dataPythonencoding
Illustration of Python string immutability and Unicode text processing.
Python

Python str Type: Immutability, Unicode, and Performance

Understand the Python str type: immutable Unicode text, common methods, formatting, encoding, and performance tradeoffs for real-world code.

Python stringsUnicodeimmutabilitystring formatting
An illustration of Python's boolean type showing True and False as integer-like values with a truthiness scale.
Python

Python bool Type: Behavior, Truthiness, and Pitfalls

Understand Python's bool type: how it inherits from int, which values are truthy, and how to avoid common comparison and conversion mistakes.

pythonbooleantruthinesstype-system
Illustration of Python complex number operations with real and imaginary axes.
Python

Python Complex Type: Working with Complex Numbers

Learn how to create, manipulate, and convert Python's built-in complex type, including arithmetic, cmath functions, conversions, and common pitfalls.

complex numbersPython numeric typescmath modulearithmetic operations
Illustration of Python float type showing binary floating-point representation and precision limits.
Python

Understanding Python's float Type and Its Precision Limits

python float type: Learn how Python's float type stores numbers, why precision errors occur, and how to handle them with proper comparisons, formatting, and alternatives.

floating-pointprecisionnumeric typespython
Illustration of a Python integer value growing in size with expanding digit storage, representing arbitrary precision.
Python

Python int Type: Arbitrary Precision and Its Costs

Python's int type is arbitrary-precision, so arithmetic does not overflow like fixed-width C integers. Learn how large values affect memory and performance, plus conversion and serialization pitfalls.

python intarbitrary precisionbig integersnumeric types
Illustration of Python numeric types showing integer, floating-point, and complex number representations
Python

Python Numeric Types: int, float, and complex Explained

python numeric types: Understand Python's built-in numeric types—int, float, and complex—including precision behavior, conversions, arithmetic rules, and common pitfalls.

PythonNumeric TypesFloating PointType Conversion