I\'m curious about the difference between lambda function and a regular function (defined with def) - in the python level. (I know what is the diff
First consider the diff b/w the two.
Lambda functions: are operator can have any number of arguments, but it can have only one expression. It cannot contain any statements and it returns a function object which can be assigned to any variable. They can be used in the block they were created.
def functions: Functions help break our program into smaller and modular chunks. As our program grows larger and larger, functions make it more organised and manageable. They can be called and used anywhere we want.
Here you can get more clear difference by following example.
def add(a,b):
return a+b
print(add(4,5))
add = lambda x, y : x + y
print(add(4,5))