Enter the name: alice

Traceback (most recent call last):

File “python”, line 45, in

File “python”, line 27, in get_average

TypeError: string indices must be integers, not str

<What do you expect to happen instead?>

I expect to get the input from the user and print the corresponding grade of the student. But I get error. Please help.

```
# Add your function below!
def average(numbers):
total = sum(numbers)
total = float(total)
return total/len(numbers)
def get_average(student):
homework = average(student["homework"])
quizzes = average(student["quizzes"])
tests = average(student["tests"])
return 0.1 * homework + 0.3 * quizzes + 0.6 * tests
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"
x = raw_input("Enter the name: ")
print get_letter_grade(get_average(x))
```