Discuss / Python / 用while 试试

用while 试试

Topic source

白霓裳酱

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

def product(x, y=1, list): num = x y for n in list: num *= n return num

白霓裳酱

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

def product(x): L=len(x) K=1 while L>0: K=Kx[L-1] L=L-1 return K

刚刚复制错了。。。。。

  • 1

Reply