File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
2_intermediate/chapter9/solutions Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 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
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 :
6666 grade_dict [student ] = "C"
6767
6868print (grade_dict )
69+
70+
You can’t perform that action at this time.
0 commit comments