Module (33%)
Section (80%)

Pay attention how the super_combiner() function is called – it’s called with genuine arguments so those arguments can be handled in the same way as they are handled by the combiner function.

If we remove the asterisks from the function call, then both tuple and dictionary would be captured by my_args, as it is supposed to handle all positional arguments (none of them is keyworded).

def combiner(a, b, *args, **kwargs): super_combiner(*args, **kwargs) def super_combiner(*my_args, **my_kwargs): print('my_args:', my_args) print('my_kwargs', my_kwargs) combiner(10, '20', 40, 60, 30, argument1=50, argument2='66')

Pay attention to the slightly modified code presented in the right pane and its output to see the differences.

my_args: ((40, 60, 30), {'argument1': 50, 'argument2': '66'}) my_kwargs {}

output


Code

def combiner(a, b, *args, **kwargs):
print(a, type(a))
print(b, type(b))
print(args, type(args))
print(kwargs, type(kwargs))


combiner(10, '20', 40, 60, 30, argument1=50, argument2='66')
{{ dockerServerErrorMsg }} ×
{{ errorMsg }} ×
{{ successMsg }} ×