return value:
The Python function has a return value, there is no return in the function body, the default return value is None,
Function parameters:
1. General Parameters
According to the order, the actual parameters are assigned to the formal parameters, each corresponding.
Cases:
def send (xxx,z,content):
Print (xxx,z,content)
Send ("yy", "dd", ' Niubi ')
2. Default parameters
Must be placed at the end of the parameter list, and the actual parameters can be defaulted and overwritten.
Cases:
def send (xxx,z,content=123):
Print (xxx,z,content)
Send ("yy", "dd", ' Niubi ')
Operation Result:
YY DD Niubi
3. Specify parameters
The actual parameter is assigned to the specified formal parameter.
Cases:
def send (xxx,z,content=123):
Print (xxx,z,content)
Send (z= "yy", xxx= "DD")
Operation Result:
DD YY 123
Python Basic Learning (ii)--functions