Just Weight and See


I don't understand the error...

def get_average(student):
homework = average("homework")
quizzes = average("quizzes")
tests = average("tests")
return (homework*0.1) + (quizzes * 0.3) + (tests * 0.6)


Oops, try again. get_average(alice) raised the following error: unsupported operand type(s) for +: 'int' and 'str




you call your average() function which calculates the averages for a list containing integers/floats, but you pass a string as argument, not a list.

You need to retrieve the student "homework" grades (which are a list), and supply this as argument


thanks for your help


you solved it? Some people struggle with such explanations


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.