Discuss / Python / 求积

求积

Topic source

def prod(x,y): return x * y print(reduce(prod,[1,3,5,6,8]))

个人比较喜欢精简代码,以下一行代码版: print(reduce(lambda x,y:x * y,[1,3,5,6,8]))


  • 1

Reply