Part of the Whole


Please help me with what is wrong with my code:

Error messages are:
Traceback (most recent call last):
File "python", line 58, in
File "python", line 55, in get_class_average
File "python", line 31, in get_average
TypeError: string indices must be integers, not str

My code is:
def get_class_average(students):
results = []
for student in students:
return average(results)
print get_class_average(students)

Thank you


your error message:

File "python", line 31, in get_average

there is also a problem in you get_average function, or somewhere. Please post your full code, preferable with markup:

So that indent will show


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