#19 - *args & **kwargs in Python

preview_player
Показать описание
Learn to use *args and **kwargs in Python. *args and **kwargs allow us to pass variable length arguments to a function. Using *args, we can pass any number of positional arguments and using **kwargs, we can pass any number of key-value pairs to a function. These two parameters are really helpful when we have to create a function where we do not know how many arguments that function will have to receive for performing some action.

While passing the variables to the function that has *args and **kwargs as their parameters, we have to add * for the variable that we want to be stored in args and we have to add ** for the variable that we want to be stored in kwargs.

Рекомендации по теме
Комментарии
Автор

Hi,

I learn with you centos and python, very thanks for videos!
I'm have a question - do you work in IT or are you just passionate about it?

waterwoda