Unpacking
We can use *
to unpack a list.
1 |
|
1 |
|
**
is used for dictionaries.
1 |
|
Packing
When we don’t know how many arguments need to be passed to a python function, we can pack all arguments in a tuple.
1 |
|
1 |
|
Sun Haozhe's Blog
We can use *
to unpack a list.
1 |
|
1 |
|
**
is used for dictionaries.
1 |
|
When we don’t know how many arguments need to be passed to a python function, we can pack all arguments in a tuple.
1 |
|
1 |
|