1. 默认参数在函数调用的时候只实例化一次
# coding:utf-8
def liFunc(li1=[]): li1.append(1) print(li1.__len__())if __name__ == '__main__': liFunc() liFunc() liFunc()结果如下: