lloyd = {
"name": "Lloyd",
"homework": [90.0, 97.0, 75.0, 92.0],
"quizzes": [88.0, 40.0, 94.0],
"tests": [75.0, 90.0]
}
students = ["lloyd","alice","tyler"]
#Accessing Dictionary from List
print students[0]['name']
Expected out is : Lloyd
whenever I run the above code I get this error,
===============================================
Traceback (most recent call last):
File "python", line 30, in <module>
TypeError: string indices must be integers
===============================================
Any help will be highly appreciated.