reordering elements of lists in a list of lists

[a[l][j] for j in order]

This is just an expression that is evaluated and then discarded.

If you want to change a, you need to assign to it:

a[l] = [a[l][j] for j in order]

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top