Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Swap list coordinates

Suppose I have list like

L = [(2,3), (4,5), (6,7)]

What's the easiest way to transform it to this list:

L'=[(3,2),(5,4),(7,5)]

i.e. swap the coordinates in each entry.

Swap coordinates of list coordinateselements

Suppose I have list like

L = [(2,3), (4,5), (6,7)]

What's the easiest way to transform it to this list:

L'=[(3,2),(5,4),(7,5)]

i.e. swap the coordinates in each entry.