class Cls():
def getfood(self):
self.food = ['Cheese', 'Pizza', 'Burger', 'Hotdog', 'Pie', 'Fires']
return self.food
c = Cls()
print getattr(c, 'getfood')()
The output of following code will be
['Cleese', 'Palin', 'Idle', 'Gilliam', 'Jones', 'Chapman']