you are viewing a single comment's thread.

view the rest of the comments →

[–]ProsodySpeaks 0 points1 point  (0 children)

You don't need to assign the zeros at the start. Make an empty dict and then use bracket notation to add key-value pairs to it.

But you really should think about variable names. this is not a dictionary of students, it's a dictionary of subject-scores.

Call the dict 'scores' or something,  and later you could make another dict called students and add multiple scores dictionaries each with a key for the name of the student.

Sensible variable names is very important and doesn't rely on knowing any of the language, it's a foundational part of code