def Sum(a,b=3,c=5):
return sum([a,b,c])
print(Sum(8,2))
上述代码的输出结果是____
return sum([a,b,c])
print(Sum(8,2))
上述代码的输出结果是____
举一反三
- def Sum(*p): return sum(p) print(Sum(3, 5, 8)) 运行结果是( )
- def Sum(a, b=3, c=5): print(a,b,c) Sum(8) 运行结果是:
- 中国大学MOOC: defSum(a,b=3,c=5):returnsum([a,b,c])print(Sum(8,2))上述代码的输出结果是____。
- def func(): global sum sum=0 print(sum) for i in range(5): sum+=1 print(sum) func() print(sum)
- 下列程序的输出结果是:sum = 0 def sum(i1, i2): result = 0 for i in range(i1, i2 + 1): result += i return result print sum(1, 10)