Our blog, or knowledge base, starts here!

I was once working with some data in Python that would generate a list of tuples, for example:

myList = [('ab',1), ('cd', 2), ('ef', 3)]

I wanted to obtain two lists from this: the first list containing the first element of each tuple and the second list containing the second element of each tuple. The zip function goes part of the way there:

Continue reading...