Discuss / Python / 我太难了我啥也不会

我太难了我啥也不会

Topic source

def mul ( *y ):

    m = 1

    k = len (y)

    if k == 0 :

        raise TypeError

    else:

        for n in y:

            m = m * n

    return m

def product (x, *l):

    if len(l) == 0:

        return x

    else:

        c = x

        for i in l:

            c = c * i

        return c


  • 1

Reply