黑猴子的家:python 函数返回值 二

A、code

# Author:黑猴子

def t1():
    print('in the test1')
    return 0
    print("haha")

z = t1()
print(z)

A、打印

in the test1
0

B、code

# Author:黑猴子
def t2():
    print('in the test1')

def t3():
    print('in the test2')
    return 0

def t4():
    print('in the test3')
    return  t3

x = t2()
y = t3()
z = t4()

print('---------------------------------')

print(x)
print(y)
print(z)

B、打印

in the test1
in the test2
in the test3
---------------------------------
None
0

你可能感兴趣的:(黑猴子的家:python 函数返回值 二)