Importance of Lambda | Sololearn: Learn to code for FREE!


Importance of Lambda

Hi Below is sample code: Time calculator is not perfect option but still I could observe that lambda takes more time compared to normal comparator. What's the use of Lambda then ?

6/20/2020 4:44:56 PM

Ketan Lalcheta

2 Answers

New Answer


You might want to consider the fact that you are using a server machine when you are executing the code off this app, what you might want to do is to run this code on your own machine(maybe a couple hundred times with at least 1000 times more values) and then check the results.


firstly, it's not consistent, sometimes lambda do faster. from what i know lambda functions at least in python is used because they only used once and contains only one line so you don't need to make another function for them but write implementation right here, because writing another function that has only one line for one case would be unnecessary