1
2
3
4
5
6
|
dicts = {"c":1, "b":2, "a":3}
print("dicts의 최대 값 구하기: {}".format(max(dicts.values())))
print("dicts의 최소 값 구하기: {}".format(min(dicts.values())))
print("dits의 최대 값을 가지는 key 구하기: {}".format(max(dicts, key=dicts.get)))
print("dits의 최소 값을 가지는 key 구하기: {}".format(min(dicts, key=dicts.get)))
|
cs |
'Programming Language > Python' 카테고리의 다른 글
파이썬 10진수 n진수로 변환 (0) | 2019.10.12 |
---|---|
Python 순열(Permutation) (0) | 2019.10.09 |
Python itertools를 이용한 순열과 조합 (combinations, permutations) (0) | 2019.10.09 |
Python String copy (0) | 2019.10.09 |
문자열 입력 Python (0) | 2019.09.28 |