python iterator functions Overview

'' ' 
Recognized function: In a complete project, certain functions will be repeated use. Will then function as a function of the package, when we want to use direct function calls to function

essentially: the function is the function of the packaging

advantages
1, to simplify the structure of the code, the code multiplicity increases (the degree of repeated use)
2, to modify a certain function or a debug BUG, also need to modify the function corresponding to the
'' '

' ''
defined function:

format:
def function name (parameter list):
statement
return expression

def: def to function block keyword start
function names: follow the rules for identifiers
(): the beginning and end of the argument list of
list of parameters (parameter 1, parameter 2, ......, parameter n): any of the parameters and variables passed into the function must be placed in the parentheses room, separated by commas. Function information from the caller where to get the function of
the colon: a function of the content (encapsulated functionality) begins with a colon and indentation
statement: function package functions
return: generally used for the end of the function, and return information to the caller of the function
expression : information that is to be returned to the caller of the function,

pay attention: the final return expression, you can not write, None equivalent return
'' '

' ''
Kay = "handsome"
Print (Kay)
'' '

' ''



Function name: to feature uses the name of the function function
parameter list: Information calling function to function is passed if no parameters, the parentheses can not omit

the nature of the function call: arguments to the formal process parameter assignment
'' '

Guess you like

Origin www.cnblogs.com/pygo/p/12242877.html