I have made a function named 'function' as below.
>>> def function():
return 'hello world'
<function function at 0x7fac99db3048> #this is the output
In python function is an object and thus when you call
function it returns you the memory address. The higher-order functions behave the same way. However there some differences:
a = def(): print("Hello, World!") b = def(): return a >>> a <function a at 0x7f8bd15ce668> >>> b <function b at 0x7f8bd15ce6e0> c = b >>>c <function b at 0x7f8bd15ce6e0> c = b() <function a at 0x7f8bd15ce668>
Note what the function
c returns in different situations.