Python - Function Keyword Arguments and Arbitrary Arguments - *args and **kwargs Code Example

preview_player
Показать описание
keyword arguments - maps arguments to parameters by name, rather than their position in the function call argument list.

default parameter value - a default value given to an argument if it’s omitted from function call argument list.

*args - a function definition parameter that allows the function to collect optional positional parameters into an arbitrary argument list tuple.

**kwargs - a function definition parameter, added at the end, that creates a dictionary of additional keyword arguments not defined in the function definition.

Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE and comment on the video if it helped you out!
Рекомендации по теме