+ 1

Can't understand def func what's he want I can't understand this...... How to solve this.....

https://code.sololearn.com/cUN5LBq60lAs/?ref=app

2nd Jun 2022, 12:11 PM
Mohammad Zakir
3 Réponses
+ 8
In this it multiply 2 * 2 and then multiply it by 4 ao we get 14 First function run and it gave 4 Anothwr gave 4*4 which is 16 I hope you understand 💕💕
2nd Jun 2022, 12:17 PM
Rakshit Pahel
Rakshit Pahel - avatar
+ 6
Hmmm you are correct
2nd Jun 2022, 1:06 PM
Rakshit Pahel
Rakshit Pahel - avatar
+ 2
test function takes two arguments (func, arg) inside test function, you are calling the "func" with "args", then passing the return value from that to "func" again. In this case: this happens test(mult, func) -> mult(mult(2)) -> mult(4) -> 16 Sort of like calling the function twice but second function argument is first function return value.
2nd Jun 2022, 1:04 PM
Sandeep
Sandeep - avatar