小甲鱼老师的18讲习题0,自己编写的
def calculate(*params):temp = list(params)
if temp.pop()!= 5:
temp = list(params)
print(sum(temp)*3)
else:
print(sum(temp)*3)
calculate(1,2,3,4,5)
或
calculate(1,2,3,4)
这两个计算结果也一致{:5_109:} 很棒!继续加油! 没有默认参数和关键字参数哦 BngThea 发表于 2017-12-4 22:23
没有默认参数和关键字参数哦
恩,没用到小甲鱼老师18讲的知识,还不熟 像番茄加两个蛋 发表于 2017-12-4 22:21
很棒!继续加油!
恩,加油!
页:
[1]