Skip to content

Commit 6b35909

Browse files
authored
Update participation_grade.py
1 parent f3420f1 commit 6b35909

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

2_intermediate/chapter9/solutions/participation_grade.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#
33
# A teacher is given a list of students.The number of occurences of a student's
44
# name in the list is the number of times the student participated this week.
5-
# If a student has more the 7 participation, then got an A. If a student has
6-
# more than 3 but less than 8, the student got a B. If a student has more than
7-
# 0 but less than 4, the student got a C.
5+
# If a student has 8 or more participations, they get an A. If a student has
6+
# between 4 and 7 participations, they get a B. If a student has more than
7+
# 0 but less than 4, the student gets a C.
88
#
99
# Make a dictionary with the keys as the students' name and the values as the
1010
# corresponding student's letter grade. Print the dictionary
@@ -57,7 +57,7 @@
5757
else:
5858
grade_dict[student] += 1
5959

60-
for student in grade_dict:
60+
for student in grade_dict.keys():
6161
if grade_dict[student] > 7:
6262
grade_dict[student] = "A"
6363
elif grade_dict[student] > 3:
@@ -66,3 +66,5 @@
6666
grade_dict[student] = "C"
6767

6868
print(grade_dict)
69+
70+

0 commit comments

Comments
 (0)