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
Sign in to make a reply
疯子_20990
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