python_54_函数调用函数

logger函数的定义要放在函数调用之前,在test1(1,2)前边,一下两种都可以
def test1(x,y):
    print(x,y)
    logger('Test1')
def logger(source):
    print("来自于%s"%source)
test1(1,2)
def logger(source):
    print("来自于%s"%source)
def test1(x,y):
    print(x,y)
    logger('Test1')
test1(1,2)

  

 
原文地址:https://www.cnblogs.com/tianqizhi/p/8351031.html