0

def apply_twice(func, arg): return func(func(arg)) def add_five(x): return x + 5 print(apply_twice(add_five, 10))

Can someone explain this code line and specially func(func(arg)) How can even exist when it is not even declared

2nd Aug 2019, 7:24 AM
SUNDARAMAN IYER
SUNDARAMAN IYER - avatar
2 Antworten
+ 6
Read how apply_twice(add_five, 10)>>> >>>add_five(add_five(10))>>> >>>add_five(15)>>> >>>20
2nd Aug 2019, 7:28 AM
Mikhail Gorchanyuk
Mikhail Gorchanyuk - avatar