Discuss / Python / 【答案】已验证!打卡0214

【答案】已验证!打卡0214

Topic source

# -*- coding: utf-8 -*-

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