Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Lambda, Map, Filter

Lambda Functions

A lambda is a small, anonymous function. Use it when you need a quick calculation but don’t want to define a full def function.

Syntax: lambda input: output

Output
10
10

Map and Filter

  • map(function, list): Applies a function to every item.

  • filter(function, list): Keeps items where the function is True.

Output
Tons: [0.1, 0.2, 0.05, 0.0, 0.3]
Active Harvests: [100, 200, 50, 300]