+ 2

Functional Programming

def apply_twice(func, arg): return func(func(arg)) def take_three(func,arg): return func(func(arg)) def subtract_three(y): return y - 3 def add_five(x): return x + 5 print(take_three(subtract_three((apply_twice(add_five, 10))) I want to subtract 3 twice from the value 20 that results from the apply_twice function. I am getting an EOF error. HELP!!

30th Jan 2020, 8:56 PM
Wi$e Xhi8F
Wi$e Xhi8F - avatar
2 Answers
+ 4
calm down simply a bracket before apply too muchđŸ€“ and one too less at end.
30th Jan 2020, 9:01 PM
Oma Falk
Oma Falk - avatar
+ 4
Wi$e Xhi8F Please link your prog next time by applying "insert" on your post.
31st Jan 2020, 8:11 AM
Oma Falk
Oma Falk - avatar