using global variables is usually considered bad practice. It is better to use the correct orientation of the objects and wrap the "data" in the proper class / object, for example.
class Questionaire(object): def __init__(self): self.data = '' def input(self): c = raw_input('Enter data1, data2:') self.data = c.split(',') def results(self): print "You entered", self.data q = Questionaire() q.input() q.results()
source share