I have a list of lists of tuples in the following form:
a = [[( 0, 1),
( 2, 3),
( 4, 5)],
[( 6, 7),
( 8, 9),
(10, 11)],
[(12, 13),
(14, 15),
(16, 17)]]
What I want to do, is to swap the two arguments inside the tuples.
I have tried the two following options, but without succes, the argumets keep their positions:
for i in range(0, len(a)-1):
for j in range(0, len(a)/2):
a[i][j] = a[i][j][1], a[i][j][0]
a[i][j] = tuple(reversed(a[i][j]))
Every help would be very much appreciated