What's the difference if we used lambda or polynomial? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What's the difference if we used lambda or polynomial?

Output will be same in both cases then what is the main use of function lambda.

15th Jun 2020, 5:30 PM
Shital Jadhav
Shital Jadhav - avatar
2 Answers
+ 4
The use of lambda function is that we can define a function and call it in a single line. For example: def square(n): return n**2 print(square(5)) print((lambda x : x**2) (5)) Here the two functions does the same thing. But lambda function makes it simple....
15th Jun 2020, 5:55 PM
Anaswar K B
+ 1
The lambda function is a single use non addressed function. This kind of function is used in the Functional Paradigm to create a complicated function that unique to an instance and will not be used again. This saves space and improves execution in Interpreted Languages, like Haskell, BCPL and Python. Remember : Python is not a pure Object Oriented Language, it is Multi-Paradigm Language.
15th Jun 2020, 6:10 PM
Anubhav Mattoo
Anubhav Mattoo - avatar