Here's my code:
Add your function below!
total = 0.0
total += sum(numbers) #add the number in numbers all together from the first one to the last one
total /= len(numbers) #divide the sum of the numbers by the length of the "numbers" list
score = 0
for person in student:
score = 0.1 * average(student["homework"]) + 0.3 * average(student["quizzes"]) + 0.6 * average(student["tests"])
guys = [lloyd, alice, tyler]
Traceback (most recent call last):
File "python", line 34, in
File "python", line 31, in get_average
TypeError: list indices must be integers, not str
why can't I use the "for loop" to print out all of the three student's grades?
I can print their grade individually but at the bottom, the "guys" list, it seems to be useless
and what dose "list indices must be integers, not str" means?
how can I fix it?
Thanks a lot for your help!
Replace this line with your code.