Discuss / Python / 作业

作业

Topic source

状元刚01

#1 Created at ... [Delete] [Delete and Lock User]
def product(*x):
    if not x:
      raise TypeError('Input is None')
    product=1    
    for i in x:
      if not isinstance(i,(int,float)):
        raise TypeError('bad perand type')
      product=product*i
    return product

  • 1

Reply