Functions as objects
Hey! In the tutorial there is this example: ----------------------------------------------------------------- def add(x, y): 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)) -------------------------------------------------------------------- which returns 15+15=30, but if i manipulate to this: --------------------------------------------------------------- def add(x, y): return 2*x + y def do_twice(func, x, y): return func(func(x, y), func(x, y)) a = 3 b = 1000 print(do_twice(add, a, b)) -------------------------------------------------------------- it returns 3018 which is 3 * 1006, but why is it not 2012 ? thanks a lot! :)