|
| 1 | +# Warning: can be challenging |
| 2 | +# |
| 3 | +# A teacher is given a list of students. The number of occurences of a student's |
| 4 | +# name in the list is the number of times the student participated in 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. |
| 8 | +# |
| 9 | +# Make a dictionary with the keys as the students' name and the values as the |
| 10 | +# corresponding student's letter grade. Print the dictionary |
| 11 | +# |
| 12 | +# Write your code below |
| 13 | + |
| 14 | + |
| 15 | +participation_occurences = ["Sam", "Dan", "Bob", "Dan", "Sam", "Sam", |
| 16 | + "Bob", "Dan", "Dan", "Ivan", "Ivan", |
| 17 | + "Ray", "Sam", "Sam", "Dan", "Ivan", "Ivan", |
| 18 | + "Ray", "Dan", "Ivan", "Ivan", "Sam", "Dan", |
| 19 | + "Ray", "Sam", "Dan", "Bob", "Dan", "Sam", |
| 20 | + "Sam", "Dan", "Bob", "Dan", "Sam", "Sam"] |
| 21 | + |
0 commit comments