I have two lists of tuples mkp1
and mkp2
which I zip
and want to unpack them later to lists. But after the first part is unpacked, the rest ist missing... Why?
Minimal example:
# list of tuples
mkp1 = [(1, 2), (3, 4), (5, 6)]
mkp2 = [(10, 20), (30, 40), (50, 60)]
# zip this list
pairs = zip(mkp1, mkp2)
# unzip this list
p1 = [kpp[0] for kpp in pairs]
p2 = [kpp[1] for kpp in pairs]
print('p1:', p1)
print('p2:', p2)
Edit: Strangely this works like I expected in Python 2.7 but not in Python 3.4.