1. 程式人生 > >函數返回值

函數返回值

內存地址 ret () hello 函數返回 def alex The test

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

函數返回值