def my_function(*args): print(args) for arg in args: print(arg) my_function(1, 2, 3)
(1, 2, 3) 1 2 3
print(1, 2) print(1, 2, 3)
1 2 1 2 3
def my_function(**kwargs): print(kwargs) for key, value in kwargs.items(): print(key, value) my_function(name="John", age=25) # Output: name John, age 25
{'name': 'John', 'age': 25} name John age 25