5.3 - Return Statements
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 screen
print(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 screen
print(my_result)

阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/seamanj/article/details/49915075
个人分类: maya python
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

5.3 - Return Statements

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭