map on uneven lists - fixed (for Python 2)
A nicer fix was this:
v1 = [1, 3, 5, 9]
v2 = [2, 6, 4, 8, 10]
print(map(lambda x,y: (x or 0) + (y or 0), v1, v2))
# [3, 9, 9, 17, 10]
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
A nicer fix was this:
v1 = [1, 3, 5, 9]
v2 = [2, 6, 4, 8, 10]
print(map(lambda x,y: (x or 0) + (y or 0), v1, v2))
# [3, 9, 9, 17, 10]