#Any way to do a custom sort with Python?
9 messages · Page 1 of 1 (latest)
u can sort in reverse
but you will have to write some logic to have it in the pattern u described
sort(reverse=True) for reverse sort
iirc
No, that was just an example. Suppose I had this order: "whq123", and all items in my list were made up of different combinations of those 6 characters. Is there a way to sort the list so that items beginning with a w come first, then h, then q, 1, 2 and 3?
Basically, I want to be able to choose one item from the list, and have every other item get sorted by the item I chose.