This question is not related to any practice problems from this site, but a general question. For example, this problem listed below requires me to scroll left to right in order to read it (imagine if it was a longer 2D list!) :
Question: Is there a way to cut this example in half (and not run into errors) so I don’t have to keep scrolling left to right due to it being so long?
If you don’t want to split that into additional variables or otherwise there’s explicit and implicit line joining. Implicit line joining is preferred is basically every style guide you’ll find so use it wherever possible. Here’s an example of implicit line joining used for your code-
last_semester_gradebook = [
["politics", 80], ["latin", 96], ["dance", 97], ["architecture", 65],
]
# or the JSON like-
last_semester_gradebook = [
["politics", 80],
["latin", 96],
["dance", 97],
["architecture", 65],
]
# you could take that further but I'm certainly not writing it out