I'm trying to figure out a way to split a list of tuples into pairs. This should work for a list that is always of an even number.
I'm drawing a bit of a blank on how to do this and hope someone can point me in the right direction.
data = [(1, 'name1'), (2, 'name2'), (3, 'name3'), (4, 'name4')]
should end up in something like:
set1 = [(1, name1, 2, name2)]
set2 = [(3, name3, 4, name4)]
How can I achieve this? Docs to read or the like?