So I was trying out the *args and **kwargs in Python. But I get an error that I cannot understand the reason of.
def new(a,b,c):
print a,b,c
a={'a': 7, 'b': 8, 'c': 9}
b={'1':7, '2':8, '3':9}
new(**a)
new(**b)
The new(**a) prints the results as expected, that is, the keys, 7,8,9. But, new(**b) gives the error:
new(**b)
TypeError: new() got an unexpected keyword argument '1'
Could anyone explain this? I am passing string as an argument in both cases, but 'a' works and '1' doesn't.