반응형
student_scores = {
"Harry": 81,
"Ron": 78,
"Hermione": 99,
"Draco": 74,
"Neville": 62,
}
student_grades = {}
for student in student_scores:
score = student_scores[student]
if score > 90:
student_grades[student] = "Outstanding"
elif score > 80:
student_grades[student] = "Exceeds Expectations"
elif score > 70:
student_grades[student] = "Acceptable"
else :
student_grades[student] = "Fail"
# 🚨 Don't change the code below 👇
print(student_grades)반응형
'파이썬 > exercise' 카테고리의 다른 글
| 9-3. python blind auction (1) | 2023.01.04 |
|---|---|
| 9-2. python dictionary in list (0) | 2023.01.04 |
| 8-3. python caesar cipher (0) | 2023.01.04 |
| 8-2. python prime number checker (0) | 2023.01.04 |
| 8-1. python function - math ceil (0) | 2023.01.04 |