Skip to content

Latest commit

 

History

History
40 lines (33 loc) · 529 Bytes

Python Lambda.md

File metadata and controls

40 lines (33 loc) · 529 Bytes
Python Lambda

lambda function is a small anonymous function. lambda function can take any number of arguments, but can only have one expression

lambda arguments : expression
x = lambda a : a+20*10
print(x(5)) 
 205
y = lambda e,n: e*n 
print(y(10,11))
110

Lambda Functions inside basic functions

def xtest(n):
  return lambda a : a * n

double1=xtest(2)
tripler2=xtest(3)

print(double1(11))
print(tripler2(11))
22
33