python函数中定义函数


def test():
    print('test')
    def test2(): # 可以定义
        print('test2')
        def test3():
            print('test3')
            
    test2()     # 可以调用


test()

# 结果
'''
test
test2
'''
原文地址:https://www.cnblogs.com/amize/p/14663189.html