python interpreter treats 'name' as the variable 'name' that is a string other than the method name() use get_name() instead of name()
class Employee:
def __init__(self, name):
self.name = name
def get_name(self):
print(self.name)
def name(self):
print(self.name)
a = "George"
e1 = Employee("")
e1.name = a
# same as
e2 = Employee(a)
e1.get_name()
e2.get_name()
try:
e1.name()
except Exception as e:
print(e)