Just Weight and See!


#1

Hey guys, I read the posts here and tried to amend my codes many times, but still gets an error! Pls help!!!!! Thanks!

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

error as below:
File "python", line 29
return 0.1 * homework + 0.3 * quizzes + \
^
SyntaxError: invalid syntax


#2

Hi this part its missng the closing )

averager()

#3

Why don’t you trys multiply the weigths of the 3 averages in the end of own of the lines?
And then you add those three avareges only in the return. Works to me.

Like this:

	homework = float(average(student["homework"]))*0.1
	return homework + quizzes + tests
get_average(alice)

#4

Thanks guys!! It is solved!


#5