Discuss / Python / 交作业了

交作业了

Topic source

疯子_20990

#1 Created at ... [Delete] [Delete and Lock User]

def product(*numbers): z = [False for i in numbers if not isinstance(i, (int, float))] if z: raise TypeError('bad input type') ret = None if len(numbers) > 0: ret = 1

for n in numbers:
    ret = n * ret
return ret

  • 1

Reply