python设置默认参数

def add(a,b,c=None):
    if c!=None:
        return a+b+c
    else:
        return a+b
if __name__ == '__main__':
    res=add(2,3,4)
    print(res)
原文地址:https://www.cnblogs.com/yibeimingyue/p/13909587.html