I have a list that look like this: ['Aaron Rodgers', '12', '36', 'Tom Brady', '9', '36', 'Phillip Rivers', '15', '75', 'Joe Theismann', '12', '36', 'Patrick Mahomes', '12', '36', 'Drew Brees', '55', '15', 'George Kittle', '15', '75', 'Deshaun Watson', '9', '500', 'Julio Jones', '15', '45'] I want to sort this list in alphabetical order pertaining to the name only. The numbers following each name are to remain with that name. For instance, 'Aaron Rodgers', '12', '36' and then followed by 'Deshaun Watson', '9', '500', followed by 'Drew Brees', '55', '15' and so on. Is this possible or do I need to put each name with the 2 numbers into thier own list so that it would be 9 lists of data inside 1 large list? Please advise if I can sort the entire list by name or if I have to break up the list into 9 nested lists within the list. Please show code for how best to sort. Finished list should be ['Aaron Rodgers', '12', '36', 'Deshaun Watson', '9', '500', 'Drew Brees', '55', '15', 'George Kittle', '15', '75', 'Joe Theismann', '12', '36', 'Julio Jones', '15', '45', 'Patrick Mahomes', '12', '36', 'Phillip Rivers', '15', '75', 'Tom Brady', '9', '36'] or [ ['Aaron Rodgers', '12', '36'], ['Deshaun Watson', '9', '500'], ['Drew Brees', '55', '15'], ['George Kittle', '15', '75'], ['Joe Theismann', '12', '36'], ['Julio Jones', '15', '45'], ['Patrick Mahomes', '12', '36'], ['Phillip Rivers', '15', '75'], ['Tom Brady', '9', '36']] Please explain how to best have the program sort this data into either finished list. Thank You
I have a list that look like this: ['Aaron Rodgers', '12', '36', 'Tom Brady', '9', '36', 'Phillip Rivers', '15', '75', 'Joe Theismann', '12', '36', 'Patrick Mahomes', '12', '36', 'Drew Brees', '55', '15', 'George Kittle', '15', '75', 'Deshaun Watson', '9', '500', 'Julio Jones', '15', '45']
I want to sort this list in alphabetical order pertaining to the name only. The numbers following each name are to remain with that name. For instance, 'Aaron Rodgers', '12', '36' and then followed by 'Deshaun Watson', '9', '500', followed by 'Drew Brees', '55', '15' and so on. Is this possible or do I need to put each name with the 2 numbers into thier own list so that it would be 9 lists of data inside 1 large list? Please advise if I can sort the entire list by name or if I have to break up the list into 9 nested lists within the list. Please show code for how best to sort. Finished list should be ['Aaron Rodgers', '12', '36', 'Deshaun Watson', '9', '500', 'Drew Brees', '55', '15', 'George Kittle', '15', '75', 'Joe Theismann', '12', '36', 'Julio Jones', '15', '45', 'Patrick Mahomes', '12', '36', 'Phillip Rivers', '15', '75', 'Tom Brady', '9', '36'] or [ ['Aaron Rodgers', '12', '36'], ['Deshaun Watson', '9', '500'], ['Drew Brees', '55', '15'], ['George Kittle', '15', '75'], ['Joe Theismann', '12', '36'], ['Julio Jones', '15', '45'], ['Patrick Mahomes', '12', '36'], ['Phillip Rivers', '15', '75'], ['Tom Brady', '9', '36']]
Please explain how to best have the program sort this data into either finished list.
Thank You
Step by step
Solved in 3 steps with 1 images