What is wrong with this?

grades = [

98,

97,

85,

88

]

gradebook = [

[“physics”, 98],

[“calculus”, 97],

[“poetry”, 85],

[“history”, 88]

]

gradebook.append([“Science”, 100])

gradebook.append([“Visual arts”, 93])

gradebook[5][1] = 93 + 5

gradebook.remove(85)

print(gradebook)

#I get this error:

Traceback (most recent call last):

File “script.py”, line 26, in
gradebook.remove(85)
ValueError: list.remove(x): x not in list

The link to the course is here https://www.codecademy.com/courses/learn-python-3/projects/python-gradebook

gradebook does not contain 85? The list/gradebook contains a bunch of dictionaries, one of these dictionaries has a value of 85. But .remove() does not go that deep

1 Like

How should I do it? It said to use .remove()

The task seems to be to remove the value from the dictionary, so you would need to call .remove() on the dictionary

2 Likes

How do I do that? :thinking: :thinking:

Did I do it correctly?
gradebook.remove(gradebook[2])

It worked, thanks for the help! :grinning: :grinning: :grinning:

1 Like