title: How to return an average grade with people's names and grades?
body: <pre><code>def average_grade(L):
      '''(list of list) -&gt; list
      L is a list of lists of strings. The first item in each
      sublist is a student name and the rest of the strings in the 
      sublist are grade values (numeric). Return a 
      new list of lists where each sublist has length 2 of
      the form [student_name (str), average grade (float)]
      &gt;&gt;&gt; average_grade([['Bob', 56, 80, 72, 90], ['Alice', 60, 88, 44, 70], ['Joe', 44, 100, 80, 60, 50]])
      [['Bob', 74.5], ['Alice', 65.5], ['Joe', 66.8]]
      '''
      new_list = [[]]
      for i in range(len(L)):
          if type(item) == type('a'):
              new_list.append(L)
              if type(item) == type(50):
                  new_list.append(sum(L)/len(L))
      return new_list
  </code></pre>
  
  <p>I have this, and it doesn't work, but I'm not sure how to fix it. Can anyone help me please?</p>