No. | category | description | notes |
---|---|---|---|
1 | operator | * is multiply, ** is square | 算数运算, *代表乘法, **代表乘方 |
2 | formal argument | unknown numbers of arguments, * for decoding as tuple , ** for decoding as dict | 函数形参,*args 和 **kwargs 主要用于函数定义, 实现将不定数量的参数传递给一个函数 |
3 | actual argument | * for decoding as tuple, ** for decoding as dict | 函数实参,如果函数的形参是定长参数,也可以使用 *args 和 **kwargs 调用函数,类似对元组和字典进行解析 |
4 | sequence unpacking | a, b, *c = 0, 1, 2, 3 => a = 0, b = 1, c=[2,3] |
Link: https://blog.csdn.net/yilovexing/article/details/80577510