Questions & AnswersPython Programming

Consider the following dataset of exam grades, organized as a 2-D...

Question
Answered step-by-step
Asked by LieutenantOxideHedgehog19 on coursehero.com

Consider the following dataset of exam grades, organized as a 2-D...

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.

 

 

 

 

 

 

 

 

Answer & Explanation

Solved by verified expert
Answered by Sys14793 on coursehero.com
sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem i
CliffsNotes Logo

Unlock access to this and over
10,000 step-by-step explanations

Unlock Explanation

Have an account? Log In

<pre><code class="language-python">sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue</code></pre>

Step-by-step explanation

sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque d

sectetur adipiscing elit. Nam lacinia pulv

sectetur adipiscing elit. Nam lacinia

sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus an

 

sectetur adipiscisecsecsesectetur adi

sectetur adipiscing elit. Nam lacinia pulvinar tortor nec

sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie conse

sectetur adipiscing elit. Nam lacini

26437841
1 attachment
Subscribe to unlock attachment
PNG

Get unstuck with a CliffsNotes subscription

Example CliffsNotes Question and Answer
Unlock every step-by-step explanation, download literature note PDFs, plus more.Get Access

Related Q&A