Python 3 gradebook project stuck on step 7

I’m stuck on the section of the project where it wants me to change the integer 93 in a 2d list to the number 98, it seems like it wants me to append the list but I cannot figure it out

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]]


#my grades

gradebook.append([‘computer science’, 100])

gradebook.append([‘visual arts’, 93])


this is what i have so far. what am i doing wrong?

Hello, @joshstover169, and welcome to the forums.

Will the append method change the value? If you print gradebook[-1][-1] what do you have? Does an integer have an append method available? Keep in mind that you can change an element of a list by selecting its index, and making an assignment.

blah = [1, 2, 3]
print(blah) #[1, 2, 3]
blah[-1] = 5
print(blah) #[1, 2, 5]

that helped, I kept getting an error that told me int has no attribute append. rather than setting it equal to the new value i was trying to append it. thank you

1 Like