# Revision history [back]

There are several ways to do this. Which one I'd use would depend more upon the context, because I'd probably write the one which generalized most naturally.

First, explicitly (useful if we're sticking with 2D or if I might be interested in other transformations):

>>> L = [(2,3), (4,5), (6,7)]
>>> M = [(y,x) for x,y in L]
>>> M
[(3, 2), (5, 4), (7, 6)]


or maybe using slice notation (seq[start:stop:step]):

>>> M = [v[::-1] for v in L]
>>> M
[(3, 2), (5, 4), (7, 6)]


>>> M = [tuple(reversed(v)) for v in L]