sh_06_ return value of the function

 

sh_06_ return value of the function

DEF sum_2_num (num1, num2):
     "" " sum of the two numbers " "" 

    the Result = num1 + num2 

    # can use the return value, function calls to tell one of the calculation results 
    return the Result
     # Note: return, says return below the code will not be executed! 
    # NUM = 1000 

# variables can be used to perform the function of receiving a return result 
sum_result = sum_2_num (10, 20 is ) 

Print ( " Calculation Results:% D " % sum_result)

 

Guess you like

Origin www.cnblogs.com/shaohan/p/11519307.html