Python sorting: Revision history

From wikinotes

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

6 February 2021

  • curprev 16:1116:11, 6 February 2021Will talk contribs 188 bytes +188 Created page with " <source lang="python"> foo = sorted(['z', 'b', 'a']) # new copy sort(mylist) # mutates 'mylist' sorted(mylist, key=lambda x: x % 2) # sort by result of 'k..."