时间:2021-07-01 10:21:17 帮助过:12人阅读
代码如下:
def powersum(power, *args):
'''Return the sum of each argument raised to specified power.'''
total = 0
for i in args:
total += pow(i, power)
return total
代码如下:
def powersum(power, *args):
'''Return the sum of each argument raised to specified power.'''
total = 0
for i in args:
total += pow(i, power)
return total
由此可见,对于python编写代码时,不能随意的缩进