码迷,mamicode.com
首页 > 其他好文 > 详细

函数返回值

时间:2018-11-06 13:27:44      阅读:135      评论:0      收藏:0      [点我收藏+]

标签:def   int   内存地址   ret   return   函数   返回   turn   返回值   

def test1():
print(‘in the test1‘)
def test2():
print(‘in the test2‘)
return 0
def test3():
print(‘in the test3‘)
return 1,‘hello‘,[‘alex‘,‘wupeiqi‘],{‘name‘:‘alex‘}
#return test2#返回test2内存地址

x=test1()
y=test2()
z=test3()
print(x)
print(y)
print(z)

in the test1
in the test2
in the test3
None
0
(1, ‘hello‘, [‘alex‘, ‘wupeiqi‘], {‘name‘: ‘alex‘})

函数返回值

标签:def   int   内存地址   ret   return   函数   返回   turn   返回值   

原文地址:https://www.cnblogs.com/rongye/p/9914412.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!