Just Weight and See


#1


https://www.codecademy.com/courses/python-beginner-en-qzsCL/1/2?curriculum_id=4f89dab3d788890003000096

File "python", line 30
return homework*0.1 + 0.3* quizzed + 0.6* test
^
SyntaxError: invalid syntax

comparing the Instructions, I don't know how to correct the line. And factly I confuse to use "[]" and "()" or neither

lloyd = {
    "name": "Lloyd",
    "homework": [90.0, 97.0, 75.0, 92.0],
    "quizzes": [88.0, 40.0, 94.0],
    "tests": [75.0, 90.0]
}
alice = {
    "name": "Alice",
    "homework": [100.0, 92.0, 98.0, 100.0],
    "quizzes": [82.0, 83.0, 91.0],
    "tests": [89.0, 97.0]
}
tyler = {
    "name": "Tyler",
    "homework": [0.0, 87.0, 75.0, 22.0],
    "quizzes": [0.0, 75.0, 78.0],
    "tests": [100.0, 100.0]
}

# Add your function below!
def average(numbers):
    total=sum(numbers)
    average=float(total)/len(numbers)
    return average
    
def get_average(student):
    homework = average(student["homework"])
    quizzed = average(student["quizzed"])
    test = average(student["test"]
    return homework*0.1 + 0.3* quizzed + 0.6* test


#2

Check your spelling.


#3

Jaja,thanks.

however it is not the only fault...

it tells me,

 File "python", line 31
    print homework*0.1 + 0.3* quizzes + 0.6* test
        ^
SyntaxError: invalid syntax

#4

thanks a lot, I get the right!


#5

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