태지쌤

로봇 & 코딩교육 No.1 크리에이터

파이썬/exercise

9-1. python dictionary 성적 등급 매기는 프로그램

태지쌤 2023. 1. 4. 16:45
반응형
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  (0) 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