I am learning Python as I go and I am not getting what I am doing wrong with my variables and being to access them in functions.
I have recreated the general layout of my script in PythonFiddle and I got the same error
global trigger
class test(object):
def init(self):
trigger = 'hi'
self.step2()
def step2(self):
print '%s' % trigger
if __name__ == "__main__":
tester = test()
tester.init()`
Anyone have any ideas?
global. That's what parameters and return values are for.