Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 767 Bytes

File metadata and controls

25 lines (17 loc) · 767 Bytes

Python Lambda Functions

 

Python lambdas are little, anonymous functions, subject to a more restrictive but more concise syntax than regular Python functions.

Lambda expressions in Python and other programming languages have their roots in lambda calculus, a model of computation invented by Alonzo Church.

Python and other languages like Java, C#, and even C++ have had lambda functions added to their syntax, whereas languages like LISP or the ML family of languages, Haskell, OCaml, and F#, use lambdas as a core concept.

Basic Syntax

lambda x: x
  • The keyword: lambda
  • A bound variable: x
  • A body: x

 

Back to Main Menu