effectivepython
effectivepython copied to clipboard
Item 37: unused variable in for loop
Item 37, in class WeightedGradebook, there's an unused variable(subject) in for loop as below. :slightly_smiling_face:
Maybe for subject, scores in by_subject.items() can be changed to for scores in by_subject.values()? :hushed:

Reference: link to related example_code Thank you! :bow: :pray:
Thank you for the report! Yes, you're right -- this would be simpler code and get rid of the unused variable.