Hello everyone,

I am really new to coding, basically just started a few weeks ago. Nonetheless, I've been working through some online tutorials to help me learn, codecademy being one. Through the advice of another website, I downloaded Aptana 3 to use for my IDE. While working through the codes on this website, I found it easier to just work through them on my IDE and copy and paste them into the online once finished.

I have been working on this exercise for a little bit now, and finally got everything to work. I copied and pasted it into the codecademy workspace and it kicks back errors everytime (i.e. when I put get_class_average([lloyd]) it says there is an error with [alice], and when I put get_class_average([alice]) it works fine but pops an error for [lloyd]). Note: as said previously, it works perfectly in my IDE though, no errors and correct results regardless of the variables used.

Below is my code, please run through it and let me know what's up. Also, one additional question as well, the last error I had with this code was the get_class_average function was defined as "def get_class_average(student) but every time I put a call on the function (regardless of the requested variables) it ran the function for everyone in the list "students". So, I was troubleshooting and just decided to through a "s" at the end of student in this line. Needless to say, it works perfectly now. I just don't fully understand why. Can anyone help explain this to me?

```
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!
students = [lloyd, alice, tyler]
def average(numbers):
total = sum(numbers)
total = float(total)
total = total / len(numbers)
return total
def get_average(student):
homework = average(student["homework"])
quizzes = average(student["quizzes"])
tests = average(student["tests"])
avg_score = (homework * 0.1) + (quizzes * 0.30) + (tests * 0.60)
print student["name"] #to see who is getting pushed through the code.
print get_letter_grade(avg_score)
return avg_score
def get_letter_grade(score):
if score >= 90:
return "A"
elif score >= 80:
return "B"
elif score >= 70:
return "C"
elif score >= 60:
return "D"
else:
return "F"
result = []
def get_class_average(students):
for student in students:
score = get_average(student)
result.append(score)
score = average(result)
return score
print "outcome of get_class_average(): "
print get_class_average([lloyd])
print
print "outcome of get_average():"
print get_average(lloyd)
print
print "print result[]:"
print result
```

Summary of questions:

- Why will is this code wrong on Codecademy but not in my IDE?

- Bonus question: Please explain to me why it produced a more reliable result as "students", instead of "student" on my def get_class_average(students) line.

Thank you for your help.