For example:
class abc():
def __init__(self):
self.john = 'a'
self.mike = 'b'
def d(self, x):
print(self.x)
m = abc()
# m.d('john')
# m.d(john)
If I try running m.d('john') I get 'AttributeError: 'abc' object has no attribute 'x'' and if I try running m.d(john) I get 'NameError: name 'john' is not defined'. How can I modify this so that it works?