Last answered:

07 Apr 2023

Posted on:

28 Mar 2023


Lambda with another lambda parameter.

I'm wondering how did we obtained the output 12 in the last example. Some step by step clarification would be appriciated.

1 answers ( 0 marked as helpful)
Posted on:

07 Apr 2023


Hi Oscr!
Thanks for reaching out.

The lambda function sum_xy accepts two arguments - a number and a lambda function. This is why when we use the argument 2 we obtain 12. This argument 2 is applied to the lambda function and we get 2*5=10. Then, we sum the argument 2 with 10 and we obtain 12.

Hope this helps.

Submit an answer