A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.w3schools.com/python/ref_keyword_lambda.asp below:

Website Navigation


Python lambda Keyword

Python lambda Keyword

❮ Python Keywords

Example

Create a function that adds 10 to any number you send:

x = lambda a : a + 10

print(x(5))

Try it Yourself » Definition and Usage

The lambda keyword is used to create small anonymous functions.

A lambda function can take any number of arguments, but can only have one expression.

The expression is evaluated and the result is returned.

More Examples Example

A lambda function with three arguments:

x = lambda a, b, c : a + b + c

print(x(5, 6, 2))

Try it Yourself » Related Pages

Read more about lambda functions in our Python Lambda Tutorial.

❮ Python Keywords

Track your progress - it's free!


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4