AI engineering glossary · Python core
What is lambda?
Lambda (also called anonymous function): A small anonymous function written in a single expression with the lambda keyword, without a name or a statement body. It is mostly used as a short argument to functions such as sorted, map and filter.
Lambda: an example
sorted(['pear', 'fig', 'apple'], key=lambda w: len(w)) returns ['fig', 'pear', 'apple'].
Related terms
More Python core terms
Where you learn it
Lambda is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.