def newfunc(n): def myfunc(x): return x + n return myfunc new = newfunc(100) print(new) Displays:
<function newfunc.<locals>.myfunc at 0x000001FF3E5A0B70> Expect exit number 200, but not in the console.
Everything is good in the console:
def newfunc(n): def myfunc(x): return x + n return myfunc new = newfunc(100) new(200)