# Allows the function to accept an unspecified amount of arguments # * - stores all unspecified parameters into a list called (conventionally called ) # = [arg1, arg2, arg3, ...] # ** - stores all unspecified parameters into a dictionary called (conventionally called ) # = {keyword1: value, keyword2: value, ...} # FULL SYNTAX: # def (arg1, arg2, ..., keyarg1=value, keyarg2=value, ..., *args, **kwargs): # ... def print_all_args(*args): for i, arg in enumerate(args): print(f"[{i}]: {arg}") def print_all_kwargs(**kwargs): for key, value in kwargs.items(): print(f"{key}: {value}") if '__main__' == __name__: print_all_args("world", "Steve", "Bob") # >>> [0]: world # >>> [1]: Steve # >>> [2]: Bob print_all_kwargs(world="Earth", system="Solar") # >>> world: Earth # >>> system: Solar