Consider the following dataset of exam grades, organized as a 2-D table and stored in Python as a "list of lists" under the variable name, grades.
grades = [ # First line is descriptive header. Subsequent lines hold data
['Student', 'Exam 1', 'Exam 2', 'Exam 3'], ['Thorny', '100', '90', '80'], ['Mac', '88', '99', '111'], ['Farva', '45', '56', '67'], ['Rabbit', '59', '61', '67'], ['Ursula', '73', '79', '83'], ['Foster', '89', '97', '101']]grades
Complete the function get_students which takes a nested list grades as a parameter and returns a new list, students, which holds the names of the students as they from "top to bottom" in the table.
My code is below and is not passing:
def get_students(grades):
students
students = [L[0] for L in grades[l:]]
It says that 'l' is not defined.
Unlock access to this and over
10,000 step-by-step explanations
Have an account? Log In