zip()
only works on lists of the same size.
a = [2, 4, 6]
b = [1, 2, 3]
zip(a, b)
output:
[(2, 1), (4, 2), (6, 3)]
I would like to somehow zip
lists of different sizes so when iterating through all the lists, even when one runs out, I can still compare the remaining lists.
ex:
a = [1, 3, 5, 7, 9, 11]
b = [2, 4, 6, 8]
output:
[(1, 2), (3, 4), (5, 6), (7, 8), (9), (11)]
Is there a function to do this? Or do I have to write separate code to make it happen?