We use *args as a parameter in the function header. It gives us the ability to pass N (variable) number of arguments.
Please note that this type of argument syntax doesn’t allow passing a named argument to the function.
Example of using the *args:
# Python code to demonstrate
# *args for dynamic arguments
def fn(*argList):
for argx in argList:
print (argx)
fn('I', 'am', 'Learning', 'Python')
The output:
I
am
Learning
Python