Contenido del Curso
Intermediate Python: Arguments, Scopes and Decorators
2. Arguments in Function
3. Function as an Argument
Intermediate Python: Arguments, Scopes and Decorators
**kwargs
Now, let's move on to keyword arbitrary arguments
or **kwargs
. The principle of how **kwargs
works is the same as for *args
, but it accepts keyword arguments instead of positional ones. **kwargs
packs information into a dictionary, so we will work with it accordingly.
The correct order for the arguments is as follows:
- Positional
- Optional
- *args
- **kwargs
If you want to unpack dictionaries, you need to use **
before the dictionary variable.
¿Todo estuvo claro?
Contenido del Curso
Intermediate Python: Arguments, Scopes and Decorators
2. Arguments in Function
3. Function as an Argument
Intermediate Python: Arguments, Scopes and Decorators
**kwargs
Now, let's move on to keyword arbitrary arguments
or **kwargs
. The principle of how **kwargs
works is the same as for *args
, but it accepts keyword arguments instead of positional ones. **kwargs
packs information into a dictionary, so we will work with it accordingly.
The correct order for the arguments is as follows:
- Positional
- Optional
- *args
- **kwargs
If you want to unpack dictionaries, you need to use **
before the dictionary variable.
¿Todo estuvo claro?