Discuss / Python / 交作业

交作业

Topic source
def product(*input):
    if len(input) == 0 or not isinstance(input[0],(int,float)):
        raise TypeError
    else:
        n = 1
        for x in input:
            n = n * x
        return n


  • 1

Reply