Guest User

Untitled

a guest
Nov 23rd, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. from itertools import izip // you may also just use zip
  2. l = [(1, 2), (3, 4), (5, 6), (7, 8), (9, 0)]
  3.  
  4. result = [sum(x) for x in izip(*l)]
  5.  
  6. print(result)
  7.  
  8. >>> [25, 20]
Add Comment
Please, Sign In to add comment