RUVIDEO
Поделитесь видео 🙏

Python Functions #7.3 Functions With *args & **kwargs

Hi All, in this video we will see what is the usage of *args & **kwargs. We will also see what is the difference between *args and **kwargs. In this video we will also see that not all args or kwargs are useful in all the situations.

The basic use of *args and **kwargs is when we want function to accept any n variable number of arguments. It means a function can accept from no or 0 argument to 1, 5, 100, or 1000 or any n number of arguments.

Another usage is the function will not result into an error if it gets any extra argument or keyword argument.

The only difference between *args and **kwargs is in first case you just need to provide values whereas in second case you need to provide key value pairs. For example funct_name(1,2,3) and funct_name(a=1,b=2,c=3). Here first is *args example and second is **kwargs example while calling the function.

Also if one has define a function with **kwargs and if the function let's say accepting only a and b keyword arguments then if you call the function with c, d or any other keyword arguments, it will result in an error or if you call the function with a, b, c, d in that case except a and b there will be no use of c, d and any other keyword arguments.

The same scenario will arise with *args. If the function is defined to use let's say first 4 values only, in that case rest of the values i.e. values from 5th number will be of no use.

We can also provide default value to keyword. In case we provide a value to keyword while calling a function, the default value will be override.

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Python Functions #7.3 Functions With *args & **kwargs», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.