In the form, I have a perfect match:
I’d want to do a basic transposition on it.
The function si(M) should reverse the places of the integers I and i+1.
For example, s2(M) should reverse the locations of integers 2 and 3:
s2(M) should yield:
Ideally written in Python 3 code. After reading from here, I converted the list of tuples to a list of lists, then swapped the values I wanted by using the index of the elements in the list of lists, but it didn’t work.