Sort by last then first
Input
sort_people([('John','Doe',30),('Jane','Doe',25)])
Output
[('Jane', 'Doe', 25), ('John', 'Doe', 30)]
Same last name 'Doe' so sorted by first name ascending.
Full lesson preview
Sort a list of people by last name, then first name, and then age (descending).
Problem statement
Task
Examples
Input
sort_people([('John','Doe',30),('Jane','Doe',25)])
Output
[('Jane', 'Doe', 25), ('John', 'Doe', 30)]
Same last name 'Doe' so sorted by first name ascending.
Input format
Output format
Constraints
Samples
Input
sort_people([('Sam','Smith',20),('Sam','Smith',30)])
Output
[('Sam', 'Smith', 30), ('Sam', 'Smith', 20)]
Same first and last names, so age is used descending.