Discuss / Python / 今天的内容好多啊

今天的内容好多啊

Topic source

不要醉酒

#1 Created at ... [Delete] [Delete and Lock User]

def product(*L):

    acc=1

    for x in L:

        acc=acc*x

    return acc

今天没做出来 这个还是参考别人的0 0

def product(*L):

    n=len(L)

    acc=1

    while x<=n-1:

        acc=acc*L[x]*L[x+1]

        x=x+1

    return acc

自己写的是这个  ,一直提示;tuple' object is not callable


  • 1

Reply