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))
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.