Sort the Class
Python
15 pts
Sort the Class
Two lists are given.
- Create
alphabetical: a new list with the names sorted A to Z, ignoring capital letters. Usesorted()withkey=str.lower. The listnamesmust not change. - Sort the list
marksitself from highest to lowest withsort().
Print alphabetical and then marks. Expected output:
['abel', 'hana', 'Merhawi', 'Selam', 'Yonas'] [92, 89, 78, 67, 45]
Checklist
- Keep the list
namesunchanged. - Create
alphabetical, a new sorted list that ignores capital letters. - Sort
marksitself from highest to lowest. - Print
alphabeticaland thenmarks.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
