Part of whole


I have the same problem, but the error says:
Oops, try again. get_class_average([alice]) returned 83.8666666667 instead of 91.15 as expected

I have the return keyword outside of my loop.

Part of the Whole

The code should include the return keyword, but for some reason it returns the wrong number? Not sure why that is.


def get_class_average(students):
results = []
students = [lloyd, alice, tyler]
for student in students:
return average(results)

This is how I have my code. Is there any changes I need to make?


why bother to give your function a parameter if you are going to overwrite it anyway?


I don't know, it says to give the function a parameter but then it says that there is an invalid syntax if I delete the 'students' list.


Just deleted the students list... It works now, but instead of making the loop "for student in class" like it asks, I had to change it to "for student in students".


yes, you have to loop over the parameter so your function works any argument supplied at function call


Thanks, was just confused for a bit there. :slight_smile: