Avatar of ugeb
ugeb
Flag for United States of America asked on

Python sort list of tuples, skipping column

I have a list of tuples of the form (A,B,C) where A, B, and C are all strings.

If, for example, lst = [ ('This','is','it') , ('This','and','that') ], the sorted order lst.sort() would give:
('This','is','it')
('This','and','that')

The first comparison item 'This' is the same in both tuples, so the next comparison item is the third value C, and 'it' comes before 'that' despite the fact that the second value 'and' comes before 'is'.

How do I sort a list of tuples like this?
PythonScripting Languages

Avatar of undefined
Last Comment
ugeb

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
JesterToo

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ugeb

ASKER
Great, thank you.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy