why 20 ? | Sololearn: Learn to code for FREE!

+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

7/4/2020 3:13:23 PM

Mitch

5 Answers

New Answer

+3

Mitch Kindly prefer to use our searchbar before asking a new question to avoid duplicates Some of them , I've listed below 👇👇👇 https://www.sololearn.com/Discuss/1418789/?ref=app https://www.sololearn.com/Discuss/1423251/?ref=app https://www.sololearn.com/Discuss/1849636/?ref=app https://www.sololearn.com/Discuss/1635939/?ref=app https://www.sololearn.com/Discuss/1914313/?ref=app https://www.sololearn.com/Discuss/2068607/?ref=app https://www.sololearn.com/Discuss/2355499/?ref=app https://www.sololearn.com/Discuss/1670513/?ref=app https://www.sololearn.com/Discuss/575766/?ref=app https://www.sololearn.com/Discuss/772323/?ref=app https://www.sololearn.com/Discuss/2073664/?ref=app https://www.sololearn.com/Discuss/772323/?ref=app https://www.sololearn.com/Discuss/2073664/?ref=app https://www.sololearn.com/Discuss/1357042/?ref=app https://www.sololearn.com/Discuss/1233458/?ref=app https://www.sololearn.com/Discuss/873436/?ref=app

+5

print(apply_twice(add_five,10))= add_five(add_five(10))=add_five(15)=20

+3

Mitch Check here how we can pass function as parameter and how it works. https://code.sololearn.com/cgfonDJu8pH0/?ref=app

+3

+2

𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥, i thank you cause you helped me to solve this code.