* Two multiplication sign is the exponentiation, such as 2**4, the result is 2 4 times, the result is 16
A multiplication sign *, if the operand is two digits, which is the two numbers multiplied, such as 2*4, the result is 8
* If a string, list, tuple is multiplied by an integer n, returns a homogeneous object with all its elements repeating n times, such as "str" to return the string "Strstrstr"
If the * in front of the parameter in the function definition is represented by placing multiple parameters on the call into a tuple, * * means that the keyword argument when the function is called is placed in a dictionary
For example, define the following function
def func (*args):p rint (args)
Parameter args is a tuple (all-in-one) when calling a function with Func
Define the following functions
def func (**args):p rint (args)
When the function is called with func (a=1,b=2), the parameter args will be the dictionary {' A ': 1, ' B ': 2}
If it is in a function call, *args means that an iterative object is extended to the argument list of the function
Args= (a)
Func= (*args)
Equivalent to function call Func (+/-)
The * * Representation of a function call expands the dictionary to a keyword parameter
Args={' A ': 1, ' B ': 2}
Func (**args)
Equivalent to function call func (a=1,b=2)
Add Buckle group 813622576 We exchange study, send free information OH!!!!!
Python * and * *