MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / average_grade

Method average_grade

example_code/item_029.py:91–97  ·  view source on GitHub ↗
(self, name)

Source from the content-addressed store, hash-verified

89 grade_list.append(grade)
90
91 def average_grade(self, name):
92 by_subject = self._grades[name]
93 total, count = 0, 0
94 for grades in by_subject.values():
95 total += sum(grades)
96 count += len(grades)
97 return total / count
98
99
100print("Example 4")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected