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 147 of 179Python Starred Unpacking: Syntax, Uses, and Pitfalls
Learn how Python's starred unpacking works for assignments, function calls, and function definitions. Includes syntax, edge cases, and performance considerations.
Python List Unpacking: Syntax and Practical Patterns
Learn Python list unpacking with practical examples, starred expressions, common errors, and the runtime behavior behind destructuring patterns.
Python List Comprehension vs Loop: Which to Use?
python list comprehension vs loop: Compare Python list comprehensions and for loops for readability, performance, and memory. Learn when each approach is the better en...
Python Nested List Comprehension: Syntax and Examples
Understand Python nested list comprehension syntax, learn to flatten nested lists, apply conditions at any level, and know when a regular loop is better.
Python List Comprehension if else: Syntax and Use Cases
Python list comprehension if/else: Learn how if/else works inside Python list comprehensions. See filtering vs transforming values, combining both forms, and avoiding common syntax errors.
Python List Comprehension with If Condition
Use if conditions in Python list comprehensions to filter items, combine conditions, and choose values with if-else. Includes nested examples and readability tips.
Python List Comprehension Syntax Explained
Understand Python list comprehension syntax with practical examples, conditionals, nested loops, and clear guidance on when a generator expression is a better choice.
Python List Comprehension: Syntax, Filtering, and Performance
Learn Python list comprehension syntax, conditional filtering, nested loops, and when a generator expression is a more memory-efficient alternative.
How to Flatten a Nested List in Python
Learn how to flatten nested lists in Python using list comprehensions, itertools.chain, recursion, generators, and an iterative stack. Compare readability, memory use, and when each approach is appropriate.
Python Two Dimensional List: Creation and Manipulation
Learn how to create, index, and iterate over two-dimensional lists in Python, including common aliasing pitfalls and when to use NumPy instead.