Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4
The 'add' function is called technically called thrice. The 'add' function is first called twice, and then both the returned values are again passed to the 'add' function func -> add func(5, 10) -> add(5, 10) -> 15 Inside the do_twice function: func(func(5, 10), func(5, 10)) -> add(add(5, 10), add(5, 10)) -> add(15, 15) -> 30
1st Aug 2022, 3:07 PM
XXX
XXX - avatar
+ 3
Yes you're right. 'func', which corresponds to 'add' is called twice with arguments (5, 10). Both those calls return the sum 5 + 10 = 15 Then both the 15s are again passed to 'func' which are added and return 15 + 15 = 30
2nd Aug 2022, 10:33 AM
XXX
XXX - avatar