0
How this produce 30 output
def add(x, y): print("abc") return x + y def do_twice(func, x, y): return func(func(x, y), func(x, y)) a = 5 b = 10 print(do_twice(add, a, b))
3 Respostas
+ 5
first it produce two 15 and then add them
+ 5
return func(func(x,y),func(x,y))
first it adds x and y twice so now arguments are add(15,15) i.e you are saying
add(add(5,10),add(5,10))
that becomes add(15,15)
+ 1
why this code adding 15,15 argument