PHP
·
发表于 5年以前
·
阅读量:7542
此函数返回列表中两个或多个数字的平均值。
def average(*args):
return sum(args, 0.0) / len(args)
average(5, 8, 2) # 5.0