5.3 - Return Statements

来源:互联网 发布:软件培训班哪个好学 编辑:程序博客网 时间:2024/06/05 09:50
def sum(value1, value2):    result = value1 + value2    return result        my_result = sum(4, 7)  # when selecting and excuting only the function part , the return value will be shown on screenprint(my_result)def sum(value1, value2): # if the ruture value is not defined, it will return a none object     result = value1 + value2        my_result = sum(4, 7)  # my_result is None. when selecting and excuting only the function part , nothing will be shown on screenprint(my_result)

0 0
原创粉丝点击