Suppose a list contains the final exam results of CSE110, PHY111, and MAT110 of each student in a listed form. Your task is to sort the list based on a course name that will be given by the user and print the names after sorting. For example, a list looks like lst = [ ["Farzad",95,87,91] , ["Mahjabin",92,90,83], ["Sadman",87,92,80], ["Nakhla",85,94,90] ] where for each list, 1st index is name, 2nd index is CSE110, 3rd index is PHY111 and 4th index is MAT110. ===================================================== Hint: create a python function for sorting, then call it everytime instead of rewriting the code. Get the data in the individual lists from the given nested list. ===================================================== Sample Input MAT110 Sample Output Farzad Nakhla Mahjabin Sadman
Suppose a list contains the final exam results of CSE110, PHY111, and MAT110 of each student in a listed form. Your task is to sort the list based on a course name that will be given by the user and print the names after sorting.
For example, a list looks like
lst = [ ["Farzad",95,87,91] , ["Mahjabin",92,90,83], ["Sadman",87,92,80], ["Nakhla",85,94,90] ]
where for each list, 1st index is name, 2nd index is CSE110, 3rd index is PHY111 and 4th index is MAT110.
=====================================================
Hint:
create a python function for sorting, then call it everytime instead of rewriting the code.
Get the data in the individual lists from the given nested list.
=====================================================
Sample Input
MAT110
Sample Output
Farzad
Nakhla
Mahjabin
Sadman
Step by step
Solved in 2 steps with 1 images