Say if you have a list like this:
List = [["james",3],["harry",1],["Joe",2]]
How would you sort it so that it sorts the list by the numbers instead of the names? i want it to produce this:
List = [["harry",1],["Joe",2],["james",3]]
What i'm currently doing:
List.sort(key=List[1])
Not sure why this doesnt work though? The website im using to learn this isnt very clear at all really.