Part of the Whole


#1

Please help me with what is wrong with my code:

Error messages are:
354.0
222.0
165.0
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:
results.append(get_average(student))
return average(results)
print get_class_average(students)

Thank you


#2

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


#3

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