World's Best AI Learning Platform with profoundly Demanding Certification Programs
Designed by IITians, only for AI Learners.
Designed by IITians, only for AI Learners.
New to InsideAIML? Create an account
Employer? Create an account
Download our e-book of Introduction To Python
4.5 (1,292 Ratings)
559 Learners
Sulochana Kamshetty
a year ago
X= 1
Y = 2
>>> lambda x, y: x + y
3
Add 20 to
argument a, and return the result:
x = lambda a : a + 20
print(x(7))
17
x = lambda a, b : a * b
print(x(4,6))
24
x
= lambda x,y,z
: x+y+z
print(x(5, 6, 2))
13
(lambda x, y: x + y)(2, 3)
5
h = lambda x: x*x*x
print(h(7))
343
def myfunc(n):
return lambda a : a * n
r = lambda x, y: x * y
r(12, 3) # call
the lambda function
36