7 ms·Simple example using python's map() and reduce()2 points by code_devil 15y agoecounysis 15y agoreduce(lambda x,y:x+y, map(lambda x:x*x, range(1,6)))mjmahone 15y agoMuch more effective, and doesn't botch the code. The blog post's code would actually return 16, due to reduce being a fold left, and the sum function incorrectly being x+x.