Consider the following:
class objectTest():
def __init__(self, a):
self.value = a
def get_value(self):
return self.value
class exec
Difference between function without parentheses and with parentheses is that when using parentheses you will get the output of that function and when you use the function without parentheses you create a copy of that function. for example
def outerFunction(text):
text = text
def innerFunction():
print(text)
return innerFunction()
if __name__ == '__main__':
outerFunction('Hey!')
x = outerFunction
y = x
x('Hey i am busy can you call me later')
y('this is not a function')
here we copy the function outerFunction to x and then copy y to x.