函数返回值

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'})

posted @ 2018-11-06 11:48  rongye  阅读(140)  评论(0编辑  收藏  举报