Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What are python parameters?
What are python parameters?
There are seven kinds.

The 1.position parameter is required and passed to the function in the order in which it was defined.

2. Keyword parameter allows you to specify the value of the parameter when calling the function, and pass it to the function using the parameter name as the keyword.

3. Variable parameters allow a variable number of parameters to be passed to the function, and these parameters are regarded as tuples.

4. Default Parameter allows setting the default value of the parameter. If no parameters are provided when calling the function, the default value will be used.

5. Only keyword parameters can only be provided in the form of keywords when defining a function, and cannot be passed to the function as positional parameters.

6. Variable keyword parameters allow a variable number of keyword parameters to be passed to the function, and these parameters are regarded as dictionaries.

7. In Python3.6 and above, variables are directly used as parameters in f-string, and these variables will be automatically replaced by values.