Apologies if the following question has already been posed on StackOverflow, but I couldn't find it posted here, nor was I able to find an answer after some time spent Googling.
My question is as follows. I would expect the following Python code,
class MNL(object):
def load_data():
r = 3 + 4
return r
def load_data_wrapper():
s = load_data()
return s
to return the output "7". Instead I get the error message "NameError: name 'load_data' is not defined".
If I change the second-to-last line to "s = self.load_data()" I get "NameError: name 'self' is not defined". For reference, I'm using Python 3.6.5.
Any help would be very much appreciated!