6. Just Weight and See


#1



What's wrong about this...? Help~


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


Replace this line with your code. 
def get_average(student):
    homework = average(student["homework"])
    quizzes = average(student["quizzes"])
    tests = average(["tests"])
    return homework*0.1 + quizzes*0.3 + tests*0.6


#2

Hi @methodcoder01636,

Do you mind posting your full code? :slight_smile:

I have a feeling the error might have to do with the previous function average(numbers)....


#4

Here u r! THX~

def average(numbers):
total = sum(numbers)
total = float(total)
total = total / len(numbers)
return total
def get_average(student):
homework = average(student["homework"])
quizzes = average(student["quizzes"])
tests = average(["tests"])
return homework*0.1 + quizzes*0.3 + tests*0.6


#5

Hi @methodcoder01636,

I was wrong; the problem with your code isn't with the average(numbers) function :stuck_out_tongue:

That is where the error lies. Can you see why?