09day

Today the main content
    1. Function
        Function is a function of the package
        grammar:
            def function name (parameter list):
                Function body (block, return)
        transfer:
            Function name (argument list)
    2. Return Values
        return:.. If you encounter a return directly back to when the function execution
        1. If any functions do not write, do not write return, no return value. Get is None
        2. At the end of the intermediate return or write function, returns None
        3. Write in the function return value. Return a value.
        4. In the return function can return multiple values, return the value 1, value 2, 3 .... value, the tuple is received
 
 
    3. Parameters
        When the function performed by the information passed to a function.
        Variable function declarations locations: * parameter
        * Arguments: function call time to a specific value
        Parameter passing: the arguments to the process parameter
 
        1. arguments:
            1. The position parameter, a position parameter according to the parameter, to the parameter value passed
            2. Keyword parameters, in accordance with the parameter name to the parameter by value
            3. mixing parameters. That is a location parameter, the key parameter is also used
        2. Katachisan:
            1. Location parameter
            2. After the default value of the parameter default values ​​first position
            3. The dynamic parameters (preview preview)
     Preview: dynamic parameters, scope
 
Function's return value
 
Using the def keyword to define the syntax defined function, the function of:
def function name (): 
    Function body
 
return:.. If you encounter a return directly back to when the function execution
        1. If any functions do not write, do not write return, no return value. Get is None
        2. At the end of the intermediate return or write function, returns None
        3. Write in the function return value. Return a value.
        4. In the return function can return multiple values, return the value 1, value 2, 3 .... value, the tuple is received
3. Parameters
        When the function performed by the information passed to a function.
        Variable function declarations locations: * parameter
        * Arguments: function call time to a specific value
        Parameter passing: the arguments to the process parameter
 
        1. arguments:
            1. The position parameter, a position parameter according to the parameter, to the parameter value passed
            2. Keyword parameters, in accordance with the parameter name to the parameter by value
            3. mixing parameters. That is a location parameter, the key parameter is also used
        2. Katachisan:
            1. Location parameter
            2. After the default value of the parameter default values ​​first position
            3. The dynamic parameters (preview preview)

Guess you like

Origin www.cnblogs.com/pythonwork/p/11493791.html