I was just testing a piece of code with kwargs and args. But why args is picking up all the passed parameters in the following code ?
def myfunc(color='red',*args,**kwargs):
print (args)
print (color)
print (kwargs)
names=["Ramesh","Krishna"]
ages={'Ramesh_age':20,'Krishna_age':10,'Kanchi_age':5}
myfunc('blue',names,ages)
Result:
(['Ramesh', 'Krishna'], {'Krishna_age': 10, 'Ramesh_age': 20, 'Kanchi_age': 5})
blue
{}
why it all including ages has been assigned to ages and kwargs is empty ?