summaryrefslogtreecommitdiff
path: root/comp/hw/111
diff options
context:
space:
mode:
authorstandenboy <standenboy@StandenboyLAP.lan>2024-01-25 08:54:02 +0000
committerstandenboy <standenboy@StandenboyLAP.lan>2024-01-25 08:54:02 +0000
commit9e83a3046472e598be3f5a9b7d104f97a97ff36a (patch)
treee2fa098952f6154a33a7f27e973abd225929fc3a /comp/hw/111
parent0969ab34e656ca044745d73a76642a8d9613b72e (diff)
fixed a fucntion on homwork
Diffstat (limited to 'comp/hw/111')
-rwxr-xr-xcomp/hw/111/students.py25
1 files changed, 15 insertions, 10 deletions
diff --git a/comp/hw/111/students.py b/comp/hw/111/students.py
index 6d9aa13..3ea8741 100755
--- a/comp/hw/111/students.py
+++ b/comp/hw/111/students.py
@@ -19,13 +19,17 @@ def top_student():
return i[0]
def grade_spread():
- print('''
- 90+ 2
- 80+ 4
- 70+ 2
- 50+ 0
- <50 0
- ''')
+ prev = 0
+ current = 50
+ count = 0
+ for x in range(6):
+ for i in students:
+ for j in i[1]:
+ if j <= current:
+ count = count + 1
+ print(f"{prev} - {current}: {count}")
+ prev = current
+ current = current + 10
def improvement(name):
for i in students:
@@ -42,7 +46,8 @@ def improvement(name):
return "not in list"
-print(calculate_mean("charlie"))
-print(top_student())
+print(f"mean for charle: {calculate_mean('charlie')}")
+print(f"the top student is: {top_student()}")
+print("the grade spread is")
grade_spread()
-print(improvement("alice"))
+print(f"the grade improvement of alice is: {improvement('alice')}")