1#------------------------------------
2#CLASS
3#------------------------------------
4class Student:
5 def __init__(self):
6 self.name = None
7
8 def set_name(self, word):
9 self.name = word
10 return self.get_name()
11
12 def get_name(self):
13 return self.name
14
15#------------------------------------
16# USAGE:
17#------------------------------------
18
19a = Student()
20print(a.set_name("Hello"))
1import foo
2method_to_call = getattr(foo, 'bar')
3result = method_to_call()
4