Programming/Python & Data Structures
[Baekjoon/Python3] 10808번 알파벳 개수
HooNeee
2020. 12. 6. 18:05
[Baekjoon/Python3] 10808번 알파벳 개수
10808번: 알파벳 개수
단어에 포함되어 있는 a의 개수, b의 개수, …, z의 개수를 공백으로 구분해서 출력한다.
www.acmicpc.net
# chr(), ord()
alp = [chr(i) for i in range(97, 123)]
cnt = []
inp = input()
for i in alp:
print(inp.count(i), end=' ')
alp = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
cnt = []
inp = input()
for i in alp:
print(inp.count(i), end=' ')