Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
ŁŲ±Ł ŲŖŲ§ŲØŲ¹ lamda ŲØŲ§ def, Ł ŁŲŁŁ Ų§Ų³ŲŖŁŲ§ŲÆŁ lamda
ŲŖŁ Ų§ŪŁŲŖŲ±ŁŲŖ ŲÆŲ±ŲØŲ§Ų±Ł Ų§ŪŁ Ų³Ų±Ś Ś©Ų±ŲÆŁ , ŁŁŪ ŚŪŲ² Ų²ŪŲ§ŲÆŪ Ł ŲŖŁŲ¬Ł ŁŲ“ŲÆŁ . Ų³ŁŲ§ŁŁ Ų§ŪŁŁ Ś©Ł ŁŲ±Ł ŁŲ§Ł ŲØŲÆŲ§ ŲØŲ§ ŲÆŁ ŚŪŁ, Ł ŚŪ Ų¬ŁŲ±Ū ŁŁŲ“ŲŖŁ Ł Ū Ų“ŁŲÆ.
4 Respostas
+ 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.
+ 1
Thanks, helped me.
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.
0
You can read about its usage in sololearn lessons about functional programming.
https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2460/