○ 알고리즘, 자료구조/2019 알고리즘
python 딕셔너리
0ver-grow
2019. 9. 24. 15:38
반응형
A = int(input())
# 딕셔너리에선 and, or가 안되는건가?
# and를 사용하면 제일 앞에 있는 12,6,9만 정상 출력되고
# or를 사용하면 제일 뒤에 있는 5,8,11만 정상 출력된다
def switch(val) :
return{
12 and 1 and 2 : "winter",
}.get(val,"nothing")
print(switch(A))
반응형