Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5
Lambdas are essentially disposable functions. It varies depending on the language. Python uses lambda <input variable(s)> : <expression(s)> and returns the output of the expression with the variable(s) passed in. e.g. lambda x: x**2 will return x squared for an input variable x. Also, if assigned to an operator they can be called as a normal function, e.g.: >>> a = lambda x:x**2 >>> a(3) 9
27th Oct 2018, 3:34 PM
Jonathan Shiell
+ 1
in which language?
27th Oct 2018, 4:18 PM
Seniru
Seniru - avatar