lambda in Python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

lambda in Python

Where is lambda used by Python?

28th Jan 2018, 6:39 PM
Andy Theodorko
Andy Theodorko - avatar
3 Answers
+ 8
lambda is used to -map -reduce -filter an array or to sort, where the sort key may be expressed by an anonymous function (eg last letter of a word) https://code.sololearn.com/c55cGt2GJQcK/?ref=app
28th Jan 2018, 6:49 PM
Oma Falk
Oma Falk - avatar
+ 6
@james thats it! The ZEN of Python is very clear here!
28th Jan 2018, 8:47 PM
Oma Falk
Oma Falk - avatar
+ 1
See this code for example - it's a short and concise onliner instead of a set of conditionals https://code.sololearn.com/cu7Mqhya2jpS/?ref=app
25th Apr 2018, 7:43 AM
Johannes
Johannes - avatar