Browse files

Sum of Pairs in Python - map idea

  • Loading branch information...
1 parent f3e4a62 commit 66c9f6c2b6ed1f3074f972e14b01730ebeb7229c @apauley committed Sep 17, 2009
Showing with 5 additions and 0 deletions.
  1. +5 −0 Snippets/SumPairs/sumpairs-map.py
View
5 Snippets/SumPairs/sumpairs-map.py
@@ -0,0 +1,5 @@
+from operator import add
+
+a = [1, 2, 3, 4, 5]
+map(add, a[1:], a[:-1])
+

0 comments on commit 66c9f6c

Please sign in to comment.