There is a list like:
list = ['AB', 'CD', 'EF', 'GH']
I would like to split this list like:
first = ['A', 'C', 'E', 'G']
second = ['B', 'D', 'F', 'H']
Now I did like this :
for element in list:
first.append(element[0])
second.append(element[1])
Is it a good way? Actually, the length of list over 600,000.
first, second = zip(*l)(granted zip will return tuples, which you could then cast into a list.for c1, c2 in my_list:*splat operator actually materializes atuple, so, if the number of arguments is large, this becomes increasingly inefficient.