You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reduce(add,map(lambdax: x[0]*x[1], zip(a,b)))
reduce(lambdax,y: x+y, map(lambdax,y: x*y, a, b))
reduce(lambdax,y: x+y[0]*y[1], zip(a,b),0) # 0 must be provided here, otherwise the first tuple of zip(a,b) would be the initial value, and error happens due to tuple type added with int type
reduce(lambda sum,(x,y): sum+x*y,zip(a,b),0)我直接复制出来