Python - What is the output: argument as dictionary?


What is the output of the following code?

def func(a, **kargs): 
    print(a, kargs) 

func(a=1, c=3, b=2) 

Click to view the answer

1 {'b': 2, 'c': 3}


1 is passed to a by name and the **kargs collects the remaining keyword arguments into a dictionary.

Related Quiz