6.1 Syntax error when there shouldn't be


#1

I'm having a problem with my code, I cannot tell why, but I'm suspecting a bug in the program. I've poured over this code time and time again and I cannot figure out the difference.

Here is my code:
def get_average(student):
homework = average(student["homework"] * 0.1,
quizzes = average(student["quizzes"] * 0.3,
tests = average(student["tests"] * 0.6,
total = homework + quizzes + tests
return sum(total)

Here is code I copied from another user:
def get_average(student):
homework = average(student["homework"])*0.1,
quizzes = average(student["quizzes"])*0.3,
tests = average(student["tests"])*0.6,
total = homework + quizzes + tests
return sum(total)

When I submit my code, it gives me the error invalid syntax on the return. When I put in the other code, it passes fine. Please let me know if there is a difference that I'm missing, otherwise I wanted to bring attention to an error that would not let me pass the unit.


#2

homework = average(student["homework"] * 0.1,
quizzes = average(student["quizzes"] * 0.3,
tests = average(student["tests"] * 0.6,

homework = average(student["homework"])*0.1,
quizzes = average(student["quizzes"])*0.3,
tests = average(student["tests"])*0.6,

You forgot parenthesis for the average function.


#3

Thanks, I've been staring at it for a half hour, and I even had my SO check it to make sure I wasn't missing anything.