티스토리 뷰
student_scores = {
"Harry": 81,
"Ron": 78,
"Hermione": 99,
"Draco": 74,
"Neville": 62,
}
# ? Don't change the code above ?
#TODO-1: Create an empty dictionary called student_grades.
student_grades = {}
#TODO-2: Write your code below to add the grades to student_grades.?
for key in student_scores:
score = student_scores[key]
if score > 90 and score <=100 :
student_grades[key] = "Outstanding"
elif score >80:
student_grades[key] = "Exceeds Expectations"
elif score >70:
student_grades[key] = "Acceptable"
else:
student_grades[key] = "Fail"
# ? Don't change the code below ?
print(student_grades)
---------------------------------------------------------
{'Harry': 'Exceeds Expectations', 'Ron': 'Acceptable', 'Hermione': 'Outstanding', 'Draco': 'Acceptable', 'Neville': 'Fail'}
'Test > Python(20220101~)' 카테고리의 다른 글
Days9_리스트 속 딕셔너리에 데이터 추가 (0) | 2022.01.13 |
---|---|
Days9_Lists, Dictionary 중첩 (0) | 2022.01.13 |
Day9_Dictionaries, Nesting (0) | 2022.01.11 |
Day8_Caesar 암호 최종, 코드 재구성(하나의 함수로 정리) (0) | 2022.01.10 |
Day8_Caesar 암호 2단계, decode (0) | 2022.01.10 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- vmware.powercli
- 대소문자
- 읽어오기
- virt-sysprep
- exadata
- powershell
- set()
- 부동없이
- 3par
- powercli
- 중복제거
- Append
- dp-2
- dp-1
- vmware
- insert
- 제곱
- EXA
- cloud-init
- 스토리지
- storage
- 배열
- LIST
- 차집합
- 정렬
- sysprep
- fromkeys
- Join
- oracle
- 변수화
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
글 보관함