0

فرق تابع lamda با def, و نحوه استفاده lamda

تو اینترنت درباره این سرچ کردم, ولی چیز زیادی متوجه نشدم. سوالم اینه که فرق لامبدا با دف چیه, و چی جوری نوشته می شود.

2nd Jul 2019, 10:20 AM
Arshia Samiezad
Arshia Samiezad - avatar
4 Réponses
+ 1
Usually we use lambda expressions for 'disposable' functions, something that we only want to use once, typically as a parameter of a higher order function such as map, filter, reduce. If you want to use a function multiple times, it is neater to define it with def keyword.
2nd Jul 2019, 10:45 AM
Tibor Santa
Tibor Santa - avatar
+ 1
Thanks, helped me.
2nd Jul 2019, 11:37 AM
Arshia Samiezad
Arshia Samiezad - avatar
0
English: I searched into Internet about lambda, but didn't understand. The question is, what's the difference between lambda and def, and how to write a lambda.
2nd Jul 2019, 10:27 AM
Arshia Samiezad
Arshia Samiezad - avatar
0
You can read about its usage in sololearn lessons about functional programming. https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2460/
2nd Jul 2019, 10:47 AM
Tibor Santa
Tibor Santa - avatar