Discuss / Python / 判断空还真难

判断空还真难

Topic source
def product(*c):
    if len(c) == 0:
         raise TypeError('bad operand type')
    else:
        s = 1
        for x in c:
            s = s*x
        print(s)
        return s

  • 1

Reply