+ 1
What is the major advantage of lambdas
5 ответов
+ 2
Lambda is the "hit it and quit it" version of a function. Its a quick way of writing a 1 time use function, so you dont have to def
+ 1
They are short and reusable with very little boilerplate
+ 1
lambda is a fancy way of saying a function. Just keep in mind of a function while working with lambda. It is quite easy to use lambda in Python.
0
It saves time with one line codes. It is also reusable instead of copy and pasting it every time. It outputs the result in an easier way as well.
0
It serves to organize the code inside a method; one of its subsections can be a lambda.
Such case could violate the Single Responsibility Principle, but could be ok if used properly.