If I have, for example, a list of tuples such as
a = [(1,2)] * 4
how would I create a list of the first element of each tuple? That is,
Two alternatives to phihag's list comprehension:
[x for x, y in a] from operator import itemgetter map(itemgetter(0), a)