1 2 3 4 5 6 7
#!/usr/bin/env python2 a = [1, 2, 3, 4, 5] b = reduce(lambda x,y: x+y, map(lambda x: x**2, a)) print b