Discuss / Python / 第二题解答

第二题解答

Topic source

不知不觉w

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

def mult(x, y): return x * y

return reduce(mult,L)

return reduce(lambda x,y: x * y,L)

不知不觉w

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

上面是两种不同的写法,第一二句是第一种,第三句是另一种。


  • 1

Reply