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

Python lambda with filter concept: a funnel filtering a stream of items, with a small lambda symbol and checkmark.
Python

Python Lambda with filter: Syntax and Practical Use

Learn how to use Python's filter() with a lambda: see syntax and examples, understand lazy evaluation, and decide when a list comprehension is clearer.

lambdafilterfunctional programmingiterables
Illustration of a Python lambda function being applied to a list via the map function, showing a transformation pipeline.
Python

Using lambda with map in Python

Combine lambda and map in Python for concise transformations. See syntax, multiple-iterable behavior, performance tradeoffs, and when to use a named function.

lambdamapfunctional programminglist comprehension
A visual comparison of Python lambda and def syntax, showing a small anonymous function next to a named function block.
Python

Python lambda vs def: Which to Use?

python lambda vs def: Understand the practical differences between Python lambda and def, including syntax, scope, debugging, and when each style fits best.

lambda functionsdef statementsanonymous functionsPython functions
Diagram showing a Python lambda with a conditional expression branching to two outcomes.
Python

Python Lambda Conditional Expressions Explained

python lambda conditional: Learn how to use conditional expressions inside Python lambdas, including syntax, nested conditions, and when to choose a named function ins...

lambdaconditional expressionsternary operatorfunctional programming
Illustration of a Python lambda function taking multiple arguments, shown as a funnel with several inputs merging into a single expression.
Python

Python Lambda Multiple Arguments: Syntax and Use Cases

Learn how to define Python lambdas with multiple arguments, use them with map and reduce, and know when a regular def function is clearer.

lambda functionspython syntaxanonymous functionsfunctional programming
Editorial illustration of a Python lambda function accepting multiple labeled argument slots feeding into an arrow.
Python

Python Lambda Arguments: Syntax and Pitfalls

Learn how Python lambda arguments work: syntax, multiple parameters, default and keyword arguments, closures, and the late-binding pitfall.

pythonlambda functionsfunctional programmingclosures
Diagram showing the anatomy of a Python lambda expression with input parameters and an expression.
Python

Python Lambda Syntax: A Practical Reference

A practical reference to Python lambda syntax, covering usage, common mistakes, performance tradeoffs, and when to prefer a regular def function.

lambdaanonymous functionsfunctional programmingpython functions
A Python lambda function symbol represented as a small anonymous function transforming data, with a clear visual metaphor for concise inline logic.
Python

Python Lambda Function: Syntax and Use Cases

Learn how to use Python lambda functions for concise anonymous functions, including syntax, common use cases, and limitations.

lambdaanonymous functionsfunctional programmingPython syntax
Illustration showing a function being passed as an argument and invoked by another function in Python
Python

Python Callback Function: Passing Functions as Arguments

Learn how Python callback functions work, how to pass functions as arguments, handle errors, and choose the right pattern for your code.

callbackshigher-order functionsfunction argumentsevent handling
Illustration of a Python higher order function passing a function into another function as an argument
Python

Python Higher Order Functions Explained with Examples

Learn how to use Python higher order functions to write cleaner, reusable code with map, filter, reduce, decorators, and closures.

higher-order functionsmap filter reducedecoratorsclosures