Lambda functions

I often forget the syntax and usage of lambda functions In mathematical logic, the lambda calculus (also written as λ-calculus) is a formal system for expressing computation based on function abstraction and application using variable binding and substitution. Untyped lambda calculus, the topic of this article, is a universal machine, a model of computation that can be used to simulate any Turing machine (and vice versa). It was introduced by the mathematician Alonzo Church in the 1930s as part of his research into the foundations of mathematics. In 1936, Church found a formulation which was logically consistent, and documented it in 1940. , the following examples should help as a reminder.

>>> def function(x):
...     return x*3
...
>>> function(2)
6
>>> func_with_lambda = lambda x: x*2
>>> func_with_lambda(2)
4
>>> (lambda x: x*2)(2)
4
>>>