I'm trying to get my head around **kwargs in python 3 and am running into a strange error. Based on this post on the matter, I tried to create my own version to confirm it worked for me.
table = {'Person A':'Age A','Person B':'Age B','Person C':'Age C'}
def kw(**kwargs):
for i,j in kwargs.items():
print(i,'is ',j)
kw(table)
The strange thing is that I keep getting back TypeError: kw() takes 0 positional arguments but 1 was given
. I have no idea why and can see no appreciable difference between my code and the code in the example at the provided link.
Can someone help me determine what is causing this error?