You can use zip () :
zipped = [(12, 1), (123, 4), (33, 4)] >>> b, c = zip(*zipped) >>> b (12, 123, 33) >>> c (1, 4, 4)
Or you could achieve something similar using a list of concepts :
>>> b, c = [e[0] for e in zipped], [e[1] for e in zipped] >>> b [12, 123, 33] >>> c [1, 4, 4]
The difference is that you get a list of tuples ( zip ), and the other is a list of lists (two lists).
In this case, the zip is likely to be more Putin and faster.
source share