class CashRegister:
def __init__(self, user, **kwargs):
self.user = user
self.items = kwargs
myRegister = CashRegister('name')
print(type(myRegister.items))
The above code tells me that self.items argument (output: <class 'dict'>) is a dictionary. So it exists. But, when I do this.
myRegister = CashRegister('name', {'a': 1, 'b': 2})
I get the following error.
myRegister = CashRegister('name', {'a': 1, 'b': 2}) TypeError: __init__() takes 2 positional arguments but 3 were given
What am I doing wrong?