Please help me check why this goes wrong?


#1



Sending a Letter
https://www.codecademy.com/en/courses/python-beginner-en-qzsCL/1/3?curriculum_id=4f89dab3d788890003000096


error messages:
"Oops, try again. Your code looks a bit off, see the console window for the error message!"


I think this code should work , but it can't.
and I can't find the problem...


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]
}

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

# Add your function below!
    
def get_letter_grade(score):
    if scroe>=90:
        return "A"
    if scroe>=80:
        return "B"
    if scroe>=70:
        return "C"
    if scroe>=60:
        return "D"
    return "F"
    
get_letter_grade(get_average(lloyd))


#2

here:

if scroe>=90:

you misspelled score

in fact, in all condition within get_letter_grade function you misspelled score


#3

Typos aplenty. Need to check spelling throughout.


#4

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