Python:函数定义

#!/usr/bin/python3

#函数

def add(a,b):
    return a+b
print("add(2,5) = ",add(2,5))



def add2(a,b,c=10):
    return a+b+c
print("默认参数 add2(a,b,c=10)")
print("add2(2,5) = ",add2(2,5))
print("add2(2,5,8) = ",add2(2,5,8))
原文地址:https://www.cnblogs.com/qin1991/p/5910160.html