Stuck on gradebook!

Hello everyone, I’m new to programming and trying to learn at my own pace. I have been stuck on the gradebook exercise and I can’t seem to figure out what the issue is, this is the code so far:

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


subjects.append("computer science")




When it prints the gradebook I can’t figure out why in the list it’s only showing the grade for computer science and I tried to figure out why but no luck, any suggestions? Thanks a lot

[['physics', 98], ['calculus', 97], ['poetry', 85], ['history', 88]]
['physics', 'calculus', 'poetry', 'history', 'computer science']
[['physics', 98], ['calculus', 97], ['poetry', 85], ['history', 88], 100]

@sergiobarbu817669156 the issue lies in this line;

subjects.append(“computer science”)

You would like to ask yourself what does it mean first, then follow by this line;

gradebook = [[“physics”, 98], [“calculus”, 97], [“poetry”, 85], [“history”, 88]]

As the value stated is an array, but how many levels does it have? And what’s their patterns like?

Once you have realized it, make the change and you’ll understand your output.

Cheers in advance for the realization :grinning_face_with_smiling_eyes:

1 Like

Well, that was easy lol !Thank you for that and yes I realized it :laughing:!


This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.