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
Popular Python guides
Most readLatest Python guides
Page 146 of 179Python Tuple Unpacking: Syntax and Patterns
Learn how Python tuple unpacking works: basic syntax, extended unpacking with *, practical patterns, edge cases, and when a named structure is clearer.
Python Tuple Packing: Syntax, Behavior, and Use Cases
python tuple packing: Learn how Python tuple packing works in assignments, function returns, and value swaps, with edge cases and runtime behavior explained.
Python Single Element Tuple: Syntax and Pitfalls
python single element tuple: Learn how to create a single-element tuple in Python, why the trailing comma is essential, and common mistakes to avoid.
Python Tuple Initialization: Syntax and Common Patterns
Learn how to initialize tuples in Python, including empty tuples, single-element tuples, and tuples created from iterables, with practical examples and common pitfalls.
Python Tuple Declaration: Syntax and Type Hints
Learn how to declare tuples in Python, including parentheses, trailing commas, type hints, immutability, and common pitfalls.
Python Tuple: Immutable Sequences and When to Use Them
Understand Python tuples: immutable sequences, packing/unpacking, memory efficiency, and when to choose tuples over lists.
Python List Mutability: Assignment and Function Calls
python list mutability: Learn how Python list mutability affects assignment, function calls, and copying, and avoid common pitfalls like shared references and mutable...
Python List vs Set: Choosing the Right Data Structure
python list vs set: Compare Python lists and sets: order, duplicates, membership testing performance, memory overhead, and when to choose each.
Python List vs Tuple: When to Use Each
python list vs tuple: Understand the differences between Python lists and tuples—mutability, memory, hashability, and performance—and when each type is the right choice.
Python List Unpacking with the Star Operator
How Python list unpacking with the star operator collects remaining values into a list, expands iterables in calls, and merges sequences in displays.