Difference between a normal function and a lambda function : lambda function « Function « Python






Difference between a normal function and a lambda function

Difference between a normal function and a lambda function


def f (x): return x**2
 
print f(8)

g = lambda x: x**2
 
print g(8)



           
       








Related examples in the same category

1.lambda function definition with default valuelambda function definition with default value
2.Define function in Lambda FormsDefine function in Lambda Forms
3.Use lambda to define simple functionUse lambda to define simple function
4.Define lambda function inside another functionDefine lambda function inside another function