Gradebook #7-9

https://www.codecademy.com/paths/visualize-data-with-python/tracks/python-for-data-analysis-dvp/modules/python-lists-dvp/projects/python-gradebook

My code for 7, 8, and 9 are all wrong, but that’s all I know. I don’t know what to change.

1 Like

For Number 7, gradebook is a 2D list so the correct code would be gradebook[-1][-1] = 98

For Number 8, you have to access the sublist in grades by doing grades[index].remove(85)
For Number 9, you will repeat what I stated in Number with the append method to add “Pass”

Hope this helps!

Damian

Hi Damian,

When I use gradebook[-1][-1] = 98…I continue to get error message

Type error: “tuple” object does not support item assignment…any thoughts

Ok, then it might be something else that is wrong with your code that is causing that TypeError to appear. Is it ok if you take another screenshot of the rest of your code?

You have
gradebook = zip(subjects, grades)
but if you want gradebook to be a list, you should do
gradebook = list(zip(subjects, grades))
or something similar.

1 Like