Explain this code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Explain this code

#named function def polynomial(x): return x**2 + 5*x + 4 print(polynomial(-4)) #lambda print((lambda x: x**2 + 5*x + 4) (-4))

13th Sep 2023, 10:36 AM
Musharaf Nazir
Musharaf Nazir - avatar
1 Answer
+ 9
Musharaf Nazir , what issue do you have in understanding: > the mathematical part of a polynomial? in this case you can use wikipedia to find more details. > the coding itself? there are 2 functions that are doing the same but in different ways. the first way is using a regular named function. the second way is using a lambda function, which is an anonymous function. both functions are explained in the related python tutorials.
13th Sep 2023, 11:01 AM
Lothar
Lothar - avatar