딕셔너리 파트 마지막 네문제
6259. 딕셔너리_7
sentence = input()
letters = 0
digit = 0
for s in sentence:
if s.isdigit():
digit += 1
if s.isalpha():
letters += 1
print(f'LETTERS {letters}\nDIGITS {digit}')
6260. 딕셔너리_8
sentence = input()
upper = 0
lower = 0
for s in sentence:
if 65<= ord(s) <=90:
upper += 1
if 97<= ord(s) <=122:
lower += 1
print('UPPER CASE {}\nLOWER CASE {}'.format(upper, lower))
6261. 딕셔너리_9
beer = {'하이트': 2000, '카스': 2100, '칭따오': 2500, '하이네켄': 4000, '버드와이저': 500}
result = { key:value*1.05 for key,value in beer.items() }
print(beer)
print(result)
6262. 딕셔너리_10
chars = input()
result = {}
for char in chars:
if char not in result.keys():
result[char] = 1
else:
result[char] += 1
for key, val in result.items():
print(key, val, sep=',')
'Algorithm problem solving > 풀이' 카테고리의 다른 글
2798. 블랙잭_fail(3/4)_pass(4/10)_pythonic(22/2/6) (0) | 2020.03.04 |
---|---|
[SW Expert Academy] 파이썬 기초2_객체지향 ( 6203~ 6229 ) (0) | 2020.03.01 |
[SW Expert Academy] 파이썬 기초2_딕셔너리 ( 6254~ 6258 ) (0) | 2020.02.29 |
[SW Expert Academy] 파이썬 기초2 ( 6232, 6239, 6241, 6243, 6248, 6678 ) (0) | 2020.02.29 |
[SW Expert Academy] 파이썬 기초2 ( 6300~ 6306 ) (0) | 2020.02.28 |