hi, I’m trying to do the gradebook escercise in python. everything was going OK until I had to remove a score from a 2d list. here’s my code:
last_semester_gradebook = [[“politics”, 80], [“latin”, 96], [“dance”, 97], [“architecture”, 65]]
# Your code below:
subjects = ["physics", "calculus", "poetry", "history"]
grades = [98, 97, 85, 88]
gradebook = [["physics", 98], ["calculus", 97],["poetry", 85],["history", 88]]
gradebook.append(["computer science", 100])
gradebook.append(["visual arts", 93])
gradebook[5][1] = (98)
gradebook.remove(85)
print(gradebook)
I get this error:
Traceback (most recent call last):
File “script.py”, line 10, in
gradebook.remove(85)
ValueError: list.remove(x): x not in list
why? the value is on the list