why 20 ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

why 20 ?

def apply_twice(func, arg): return func(func(arg)) def add_five(x): return x + 5 print(apply_twice(add_five, 10)) set to me the process, pls

4th Jul 2020, 3:13 PM
Merveille Mitch
Merveille Mitch - avatar
3 Answers
+ 5
print(apply_twice(add_five,10))= add_five(add_five(10))=add_five(15)=20
4th Jul 2020, 3:47 PM
Julia Shabanova
Julia Shabanova - avatar
+ 3
Mitch Check here how we can pass function as parameter and how it works. https://code.sololearn.com/cgfonDJu8pH0/?ref=app
4th Jul 2020, 3:51 PM
A͢J
A͢J - avatar
+ 2
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥, i thank you cause you helped me to solve this code.
4th Jul 2020, 6:39 PM
Merveille Mitch
Merveille Mitch - avatar