I have written a class, in which the constructor receives a dictionary, as shown in the following code:
class Test:
def __init__(self, **kwargs):
for key, value in kwargs.items():
self.key = value
what i want to do at the end is the ability to reference each key as shown in the following piece of code:
T = Test(age=34, name='david')
print(T.age)
instead i get keyword can't be an expression..