I'm trying to complete this assignment for a class. The instructions say to:
Lis a list of lists. The first item in each sublist is a student name and the rest of the items in the sublist are grade values (floatorint). Return a new list of lists where each sublist has length 2 of the form[student_name (str), average grade (float)]>>> 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]]
The problem that I'm having with my code is that I'm trying to be able to enter in the lists, but only find the average of the integers. So far I have this:
for int in ['Bob', 'Alice', 'Joe']:
return (map(L[sum(int)/len(int)]), map(L[sum(int)/len(int)]), map(L[sum(int)/len(int)]))
But when I enter in even only one list, I get this:
builtins.TypeError: unsupported operand type(s) for +: 'int' and 'str'
I'm not sure what to do here. Any help?