def all_aboard(a, *args, **kw):
print(a, args, kw)
all_aboard(4, 7, 3, 0, x=10, y=64)
I want to know how this works as the output of the program is
4 (7, 3, 0) {'x': 10, 'y': 64}
How is the code computed?
>Solution :
all_aboard parameters are:
a– you already know it*args– any number of parameters which are set as tuple**kw– give you all keyword arguments except for those corresponding to a formal parameter as a dictionary
For this reason the output is:
4 (7, 3, 0) {'x': 10, 'y': 64}
since a = 4, *args = (7, 3, 0) and **kw = {'x': 10, 'y': 64}