Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -45,10 +45,10 @@ class Chapter:
|
|
45 |
self.data[chapter_name]["count"] += 1
|
46 |
|
47 |
def print_averages(self):
|
48 |
-
|
49 |
if stats["count"] > 0:
|
50 |
avg = stats["sum_marks"] / stats["count"]
|
51 |
-
|
52 |
|
53 |
class PhysicsChapter(Chapter):
|
54 |
pass
|
|
|
45 |
self.data[chapter_name]["count"] += 1
|
46 |
|
47 |
def print_averages(self):
|
48 |
+
for chapter, stats in self.data.items():
|
49 |
if stats["count"] > 0:
|
50 |
avg = stats["sum_marks"] / stats["count"]
|
51 |
+
return f"{chapter}: Average = {round(avg, 1)}"
|
52 |
|
53 |
class PhysicsChapter(Chapter):
|
54 |
pass
|