# Function return value
Def get_max (A, B, C ):
Max_num =
If B> max_num:
Max_num = B
If C> max_num:
Max_num = C
Returm max_num
Max_number = get_max (1, 5, 3)
Print ('maxim', max_number)
Print (get_max (-2, 5, 40 ))
Get_max ()
# Function return value:
The parameter enters the function. After some business logic processing, the processed result is returned.
# The return value starts with return. It can return numbers, strings, and boolean values.
# Generally, the return value of a function is clearly defined. The calculation logic should be separated from the business logic.
# It is recommended that clear values be returned. If a function with a return value is disabled, none is returned by default.
# Easy to error: the function does not contain print (). After the function is called, the terminal cannot see the result because the terminal accepts and prints the return value of the function.
#2. functions that do not need to return values, but encapsulation of some functions
Def maday ():
Print ('upgrade ')
Print ('eat breakfast ')
Print ('workday ')
Print ('sleep ')
Print ('doubean ')
#3. functions that return multiple values
Def get_max_min (A, B, C ):
Max_num =
Max_min =
If B> max_num:
Max_num = B
If C> max_num:
Max_num = C
If B <max_min:
Max_min = B
If C <max_min:
Max_min = C
Return max_num, max_min
Num1, num2 = get_max_min (1, 5, 3)
Print ('maximum {}, minimum '. Format (num1, num2 ))
# A function can have multiple return values separated by commas (,) during return.
# Destructor assignment and unpackage assignment: the number of values returned by the function is accepted by the number of variables in the same order.
L3. II. Return