Just weight and see


#1

def average(numbers):
total = sum(numbers)
total = float(total) / len(numbers)
return average

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

after which i can error

Oops, try again. get_average(alice) raised the following error: unsupported operand type(s) for *: 'function' and 'float'

Can someone explain what went worng?


#2
def average(numbers):
    total = float(sum(numbers))
    total = total / len(numbers)
    return average

def average(numbers):
    total = float(sum(numbers)) / len(numbers)
    return average