When I create a function in python for example
def foo():
pass
And when I type print(type(foo))
it returns class ‘function’
,
so my question is if every function we create belongs to class ‘function’ why we print foo()
instead of function.foo()
to call this function?
Because if I create a class and add a method to call this method I would write classname.method()