Problem:


Counting Characters

  Write a program which counts and reports the number of each alphabetical letter. Ignore the case of characters.

Input

  A sentence in English is given in several lines.

Output

  Prints the number of alphabetical letters in the following format:

a : The number of 'a'
b : The number of 'b'
c : The number of 'c'
  .
  .
z : The number of 'z'

Constraints

The number of characters in the sentence < 1200

Sample Input

This is a pen.

Sample Output

a : 1
b : 0
c : 0
d : 0
e : 1
f : 0
g : 0
h : 1
i : 2
j : 0
k : 0
l : 0
m : 0
n : 1
o : 0
p : 1
q : 0
r : 0
s : 2
t : 1
u : 0
v : 0
w : 0
x : 0
y : 0
z : 0



Sample input:
This is a pen.


Sample output:
a : 1
b : 0
c : 0
d : 0
e : 1
f : 0
g : 0
h : 1
i : 2
j : 0
k : 0
l : 0
m : 0
n : 1
o : 0
p : 1
q : 0
r : 0
s : 2
t : 1
u : 0
v : 0
w : 0
x : 0
y : 0
z : 0

Submission status: Accepted

Solution code:
n=[0 for i in range(30)]

while True:
    try:
        s=input()
    except EOFError:
        break
    n[0]+=s.count('a')+s.count('A')
    n[1]+=s.count('b')+s.count('B')
    n[2]+=s.count('c')+s.count('C')
    n[3]+=s.count('d')+s.count('D')
    n[4]+=s.count('e')+s.count('E')
    n[5]+=s.count('f')+s.count('F')
    n[6]+=s.count('g')+s.count('G')
    n[7]+=s.count('h')+s.count('H')
    n[8]+=s.count('i')+s.count('I')
    n[9]+=s.count('j')+s.count('J')
    n[10]+=s.count('k')+s.count('K')
    n[11]+=s.count('l')+s.count('L')
    n[12]+=s.count('m')+s.count('M')
    n[13]+=s.count('n')+s.count('N')
    n[14]+=s.count('o')+s.count('O')
    n[15]+=s.count('p')+s.count('P')
    n[16]+=s.count('q')+s.count('Q')
    n[17]+=s.count('r')+s.count('R')
    n[18]+=s.count('s')+s.count('S')
    n[19]+=s.count('t')+s.count('T')
    n[20]+=s.count('u')+s.count('U')
    n[21]+=s.count('v')+s.count('V')
    n[22]+=s.count('w')+s.count('W')
    n[23]+=s.count('x')+s.count('X')
    n[24]+=s.count('y')+s.count('Y')
    n[25]+=s.count('z')+s.count('Z')

print(f"a : {n[0]}")
print(f"b : {n[1]}")
print(f"c : {n[2]}")
print(f"d : {n[3]}")
print(f"e : {n[4]}")
print(f"f : {n[5]}")
print(f"g : {n[6]}")
print(f"h : {n[7]}")
print(f"i : {n[8]}")
print(f"j : {n[9]}")
print(f"k : {n[10]}")
print(f"l : {n[11]}")
print(f"m : {n[12]}")
print(f"n : {n[13]}")
print(f"o : {n[14]}")
print(f"p : {n[15]}")
print(f"q : {n[16]}")
print(f"r : {n[17]}")
print(f"s : {n[18]}")
print(f"t : {n[19]}")
print(f"u : {n[20]}")
print(f"v : {n[21]}")
print(f"w : {n[22]}")
print(f"x : {n[23]}")
print(f"y : {n[24]}")
print(f"z : {n[25]}")

Submission status: Accepted

Solution code:
import sys
alp="abcdefghijklmnopqrstuvwxyz"

str=sys.stdin.read()
for i in alp:
	print(f"{i} : {str.lower().count(i)}")

Submission status: Accepted

Solution code:
alp = {chr(x): 0 for x in range(97, 123)}

while True:
    try:
        s = input().lower()
        for c in s:
            if c.isalpha():
                alp[c] += 1
    except EOFError:
        break

for k in alp:
    print(f'{k} : {alp[k]}')

Submission status: Accepted

Solution code:
count = [0 for i in range(26)]
while True:
    try:
        str = input().lower()
    except EOFError:
        break
    for i in range(len(str)):
        for j in range(26):
            if ord(str[i])==97+j:
                count[j]+=1
                break
for i in range(26):
    print(f"{chr(97+i)} : {count[i]}")

Submission status: Accepted

Solution code:
letters = "abcdefghijklmnopqrstuvwxyz"

table = [0]*26

while True:
    try:
        line = input()

        for i in line:
            index = 0
            for j in letters:
                if i == j or i == j.upper():
                    table[index]+=1
                index+=1
    except:
        break

for i in range(len(letters)):
    print("%s : %d"%(letters[i],table[i]))

Submission status: Accepted

Solution code:
import sys
import collections

c ={}
s = sys.stdin.read()
c = collections.Counter(s.lower())
for i in range(97,123):
    print(chr(i),":",c[chr(i)])

Submission status: Accepted

Solution code:
import sys
  
BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
  
  
table = [0]*26
  
letters = "abcdefghijklmnopqrstuvwxyz"
input_str = sys.stdin.read()
  
for A in input_str:
    index = 0
    for B in letters:
        if A == B or A == B.upper():
            table[index] += 1
            break
        index += 1
  
for i in range(len(letters)):
    print("%s : %d"%(letters[i],table[i]))

Submission status: Accepted

Solution code:
s = open(0).read()
s = s.lower()
count = [0 for i in range(26)]
for i in range(len(s)):
    m = ord(s[i]) - ord('a')
    if m >= 0 and m < 26:
        count[m] += 1 

for i in range(26):
    print(chr(i + ord('a')),":",count[i])

Submission status: Accepted

Solution code:
import sys, string

lines = sys.stdin.read().lower()
for x in string.ascii_lowercase:
    print('{} : {}'.format(x, lines.count(x)))

Submission status: Accepted

Solution code:
import sys

c_dict = {
'a':0, 'b':0, 'c':0, 'd':0, 'e':0, 'f':0, 'g':0,
'h':0, 'i':0, 'j':0, 'k':0, 'l':0, 'm':0, 'n':0,
'o':0, 'p':0, 'q':0, 'r':0, 's':0, 't':0, 'u':0,
'v':0, 'w':0, 'x':0, 'y':0, 'z':0
}

while True:
    a = sys.stdin.readline()
    if not a:
        break
    else:
        str = a.lower() #すべての文字を小文字に変換
        for i in str: #strの中身を一文字ずつiに入れる
            if i in c_dict: #c_dictにiが含まれているかどうか，含まれる→True，含まれない→False
                c_dict[i] = c_dict[i] + 1 #print(c_dict[i]) >>> 値
            """ #もし，辞書に無い文字を追加したければ，これでできる（appendしなくていいの利点）
            else:
                c_dict[i] = 1
            """

for i in c_dict:
    print(i,':',c_dict[i])

Submission status: Accepted

Solution code:
#from numpy import*
#from scipy import*
from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby
from operator import mul
from bisect import* #bisect_left bisect_right
from heapq import* #heapify heappop heappushpop
from math import factorial,pi
from copy import deepcopy
import sys
#input=sys.stdin.readline  #危険！基本オフにしろ！
sys.setrecursionlimit(10**6)


def main():
    d=defaultdict(int)
    for i in open(0).read().lower():
        d[i]+=1
    for i in [chr(j)for j in range(97,123)]:
        print(i,":",d[i])
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import fileinput

# DEFINE
ALPHABET= "abcdefghijklmnopqrstuvwxyz"

dict_alphabet = {}

for key in ALPHABET:
    dict_alphabet[key] = 0


# COUNT
for line in fileinput.input():
    for letter in line.lower():
        if letter in dict_alphabet:
            dict_alphabet[letter] += 1


# OUTPUT
for key, value in dict_alphabet.items():

    print(f"{key} : {value}")

Submission status: Accepted

Solution code:
import sys
count={chr(97+i):0 for i in range(26)}
line=sys.stdin.read()
line=line.lower()

for i in range(len(line)):
    if line[i] in count:
        count[line[i]]+=1

for i in range(97,97+26):
    print(chr(i)+' : '+str(count[chr(i)]))

Submission status: Accepted

Solution code:
data = [0 for _ in range(26)]
while True:
    try:
        moji = input()
    except EOFError:
        break
    for m in moji:
        point = ord(m)
        if 65 <= point <= 90:
            data[point - 65] += 1
        elif 97 <= point <= 122:
            data[point - 97] += 1
[print(f'{chr(i + 97)} : {data[i]}') for i in range(26)]

Submission status: Accepted

Solution code:
import sys
   
BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
   
   
table = [0]*26
   
letters = "abcdefghijklmnopqrstuvwxyz"
input_str = sys.stdin.read()
   
for A in input_str:
    index = 0
    for B in letters:
        if A == B or A == B.upper():
            table[index] += 1
            break
        index += 1
   
for i in range(len(letters)):
    print("%s : %d"%(letters[i],table[i]))

Submission status: Accepted

Solution code:
#IPT1_8_C　アルファベットカウント
import sys

uppers = [chr(i) for i in range(65,65+26)]
lowers = [chr(i) for i in range(97,97+26)]
alphabet = lowers + uppers
count_dict = dict(zip(lowers , [0 for i in range(len(lowers))]))

sentence = sys.stdin.read()

for s in sentence:
    for a in alphabet:
        if s == a:
            count_dict[a.lower()] += 1

for key, value in count_dict.items():
    print(key, ":", value)

Submission status: Accepted

Solution code:
def count_char(chars):
    res = {chr(i): 0 for i in range(97, 123)}
    for c in chars.lower():
        if c in res:
            res[c] += 1
    return(res)


if __name__ == "__main__":
    
    s = ""
    while True:
        try:
            s += input()
        except:
           break

    for k, v in count_char(s).items():
        print(f"{k} : {v}")

Submission status: Accepted

Solution code:
from sys import stdin

S = stdin.read().lower()

alphabet = 'abcdefghijklmnopqrstuvwxyz'
count = [0] * len(alphabet)

for c in S:
    if c in alphabet:
        i = alphabet.index(c)
        count[i] += 1

for i in range(len(alphabet)):
    print(alphabet[i], ':', count[i])

Submission status: Accepted

Solution code:
import sys
alpha = "abcdefghijklmnopqrstuvwxyz"
str = sys.stdin.read()
str = str.lower()

for i in range(len(alpha)):
    print("{} : {}".format(alpha[i],str.count(alpha[i])))

Submission status: Accepted

Solution code:
nyuryoku = ""

try:
    while True:
        s = input()
        if s == '':
            break
        nyuryoku += s

except EOFError:
    pass

s = nyuryoku

a = "abcdefghijklmnopqrstuvwxyz"
alphabet = [0] * 26

for i in range(len(s)):
    for j in range(len(a)):
        if(s[i] == a[j] or s[i] == a[j].upper()):
            alphabet[j] += 1
            
for i in range(len(a)):
    print("{} : {}".format(a[i],alphabet[i]))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
	string = "abcdefghijklmnopqrstuvwxyz"
	data = ""
	while True:
		try:
			data += str(input())
		except:
			break		
	for i in string:
		print("%s : %d" % (i ,data.lower().count(i)))

Submission status: Accepted

Solution code:
cnt = [0 for i in range(26)]
letters = "abcdefghijklmnopqrstuvwxyz"
str = open(0).read()
for c in str:
  for j in range(len(letters)):
    if c == letters[j] or c == letters[j].upper():
      cnt[j] += 1
      break
for i in range(26):
  print(letters[i], ":", cnt[i])

Submission status: Accepted

Solution code:
import sys
s = sys.stdin.read().lower()
count = [0 for i in range(26)]
for j in s:
    num = ord(j) - ord('a')
    if num >= 0 and num <= 25:
        count[num] += 1
for k in range(26):
    print(chr(k + 97) + " : " + str(count[k]))

Submission status: Accepted

Solution code:
x = ''
while 1:
    try:
        x += input()
    except:
        break
    
str_a = [chr(i) for i in range(ord('a'), ord('z') + 1)]
str_A = [chr(i) for i in range(ord('A'), ord('Z') + 1)]
count = [0] * 26
for i in x:
    if i in str_a:
        count[str_a.index(i)] += 1
    elif i in str_A:
        count[str_A.index(i)] += 1
for i, j in zip(str_a, count):
    print('{} : {}'.format(i, j))

Submission status: Accepted

Solution code:
import collections
import sys
c = collections.Counter(''.join(sys.stdin).lower())
for x in 'abcdefghijklmnopqrstuvwxyz':
	print(x,':',c[x])

Submission status: Accepted

Solution code:
import sys
lines = '' 
for line in sys.stdin.readlines():
    if not line:
        break
    else:
        lines += line.lower()

a = ord('a')
z = ord('z')
n = z - a + 1
lis1 = list(map(chr, (_ for _ in range(a, z+1))))
lis2 = [0]*n
d = dict(zip(lis1, lis2))
for c in lines:
        if c in lis1:
            d[c] += 1
for i in d:
    print('{} : {}'.format(i, d[i]))

Submission status: Accepted

Solution code:
s = []
a=list('abcdefghijklmnopqrstuvwxyz')
while 1:
    try:
        x=input()
    except EOFError:
        break
    s+=list(x.lower())
for i in a:
    print('{} : {}'.format(i, s.count(i)))

Submission status: Accepted

Solution code:
import sys
import string
lower_case = string.ascii_lowercase

alphabets = {}
for letter in lower_case:
     alphabets.setdefault(letter, 0)

string = []
for line in sys.stdin:
    string.append(line)

for line in string:
    for letter in line:
        lower_letter = letter.lower()
        try :
            alphabets[lower_letter] += 1
        except:
            pass

for k, v in alphabets.items():
    print('{} : {}'.format(k,v))

Submission status: Accepted

Solution code:
import string
import sys

number = []

all = list(string.ascii_lowercase)

for i in range(26):
    number.append(0)

moji = sys.stdin.read()
T = list(moji.lower())

for i in range(26):
    for j in range(len(moji)):
        if T[j] == all[i]:
            number[i] += 1

for i in range(26):
    print(all[i], ":", number[i])

Submission status: Accepted

Solution code:
import sys

table = [0]*26
letters = 'abcdefghijklmnopqrstuvwxyz'

input_str = sys.stdin.read()

for i in range(len(input_str)):
    for j in range(len(letters)):
        if input_str[i] == letters[j] or input_str[i] == letters[j].upper():
            table[j] += 1

for i in range(len(letters)):
    print('{} : {}'.format(letters[i],table[i]))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# ITP1_8_C
# 文字のカウント

alphabet = "abcdefghijklmnopqrstuvwxyz"
ansdict = {}
data = ""

try:
    while 1:
        data += input()        
except EOFError:
    pass

data = data.lower()

for i in data:
    if i in ansdict.keys():
        ansdict[i] += 1
    else:
        ansdict[i] = 1
for i in alphabet:
    print("{} : {}".format(i, ansdict.get(i, 0)))

Submission status: Accepted

Solution code:
import sys

table = [0]*26
 
letters = "abcdefghijklmnopqrstuvwxyz"
input_str = sys.stdin.read()
 
for A in input_str:
    index = 0
    for B in letters:
        if A == B or A == B.upper():
            table[index] += 1
            break
        index += 1
 
for i in range(len(letters)):
    print("%s : %d"%(letters[i],table[i]))

Submission status: Accepted

Solution code:
import string
import sys
A = list(string.ascii_lowercase)
l = ""
for i in sys.stdin:
    l += i
L = l.lower()
for i in A:
    counter = L.count(i)
    print(i,":",counter)

Submission status: Accepted

Solution code:
import sys
table = [0]*26
 
letters = "abcdefghijklmnopqrstuvwxyz"
input_str = sys.stdin.read()
 
for A in input_str:
    index = 0
    for B in letters:
        if A == B or A == B.upper():
            table[index] += 1
            break
        index += 1
 
for i in range(len(letters)):
    print("%s : %d"%(letters[i],table[i]))

Submission status: Accepted

Solution code:
import sys

def count_chars(str):
    lst = [0 for x in range(26)]
    a = ord("a")

    for c in str:
        n = ord(c) - a
        if 0 <= n < 26:
            lst[n] += 1

    return lst

a = ord("a")
str = ""

for line in sys.stdin:
    str += " " + line.lower()

lst = count_chars(str)

for i, x in enumerate(lst):
        print(chr(i+a), ":", x)

Submission status: Accepted

Solution code:
#アルファベットリストの作成
count = {}
for i in range(26):
    count[chr(ord('a') + i)] = 0

#入力情報を記録
list = []
try:
    while True:
        inp = input().lower()
        if inp == "":
            break
        list += inp
except EOFError:
    pass

#入力情報の文字数をカウントする
for i in range(len(list)):
    for j in range(len(list[i])):
        if list[i][j] in count.keys():
            count[list[i][j]] += 1

for k, v in count.items():
    print(k,":",v)

Submission status: Accepted

Solution code:
import sys
from collections import Counter
from string import ascii_lowercase

counter = Counter()
for s in sys.stdin:
    counter.update(s.lower())

for c in ascii_lowercase:
    print(f'{c} : {counter[c]}')

Submission status: Accepted

Solution code:
ctlist = [0 for i in range(26)]
str1 = open(0).read()

for i in str1:
    if i.isupper():
        ctlist[ord(i) - ord('A')] += 1
    elif i.islower():
        ctlist[ord(i) - ord('a')] += 1

for i in range(26):
    print(chr(i + ord('a')), ":", ctlist[i])

Submission status: Accepted

Solution code:
s = ''
while True:
    try:
        i = input()
        s += i
    except:
        break

letters = 'abcdefghijklmnopqrstuvwxyz'

for l in letters:
    print('{0} : {1}'.format(l, s.lower().count('{}'.format(l))))

Submission status: Accepted

Solution code:
import sys

table = [0]*26
 
letters = "abcdefghijklmnopqrstuvwxyz"

sentence = sys.stdin.read()


for A in sentence:
    index = int(0)
    
    for B in letters:

        if A == B or A == B.upper():
            table[index]  += 1
            break
        index += 1


for i in range(len(letters)):

    print("%s : %d" %( letters[i], table[i]) )

Submission status: Accepted

Solution code:
inp=""

while True:
    try:
        in1 = input()
        inp =inp + in1
    except EOFError:
        break

s = "abcdefghijklmnopqrstuvwxyz"
l = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
count=[0]*26

for i in inp:
    if i in s:
        count[s.index(i)]+=1
    if i in l:
        count[l.index(i)]+=1

for i in range(len(count)):
    print(s[i]+" : "+str(count[i]))

Submission status: Accepted

Solution code:
s = ''
while True:
    try:
        s += input().lower()
    except EOFError:
        break
alpha = 'abcdefghijklmnopqrstuvwxyz'
c = {}
for _ in alpha:
    c[_] = 0
for ch in s:
    
    if ch.isalpha():
        c[ch] += 1
        
for key in c:
    print(key,':', c[key])

Submission status: Accepted

Solution code:
import sys
moji = sys.stdin.read().lower()
for i in range(97, 97+26):
    print(f'{chr(i)} : {moji.count(chr(i))}')

Submission status: Accepted

Solution code:
n = ""
while True:
    try:
        n += input().lower()
    except:
        break
for i in range(97, 97+26):
    print(chr(i),":",n.count(chr(i)),sep=" ")

Submission status: Accepted

Solution code:
di = { chr(i):0 for i in range(97,97+26)}
try:
    while 1:
        l = [x for x in input().lower()]
        for i in range(len(l)):
            if l[i] in di:
                di[l[i]] += 1
except EOFError:
    pass
for a, b in di.items():
    print(a ,":" , b)

Submission status: Accepted

Solution code:
str = ''
count = {}
for c in [chr(i) for i in range(97, 123)]:
  count[c] = 0

while True:
  try:
    tmp = input()
    str += tmp
  except:
    break

for char in str:
  for c in count:
    if char.upper() == c.upper():
      count[c] += 1

for c, n in count.items():
  print(c, ':', n)

Submission status: Accepted

Solution code:
import collections

sentence = ""
while True:
  try:
    line = input().lower()
    sentence += line
  except EOFError:
    break

c = collections.Counter(sentence)

print("a : {}".format(c['a']))
print("b : {}".format(c['b']))
print("c : {}".format(c['c']))
print("d : {}".format(c['d']))
print("e : {}".format(c['e']))
print("f : {}".format(c['f']))
print("g : {}".format(c['g']))
print("h : {}".format(c['h']))
print("i : {}".format(c['i']))
print("j : {}".format(c['j']))
print("k : {}".format(c['k']))
print("l : {}".format(c['l']))
print("m : {}".format(c['m']))
print("n : {}".format(c['n']))
print("o : {}".format(c['o']))
print("p : {}".format(c['p']))
print("q : {}".format(c['q']))
print("r : {}".format(c['r']))
print("s : {}".format(c['s']))
print("t : {}".format(c['t']))
print("u : {}".format(c['u']))
print("v : {}".format(c['v']))
print("w : {}".format(c['w']))
print("x : {}".format(c['x']))
print("y : {}".format(c['y']))
print("z : {}".format(c['z']))

Submission status: Accepted

Solution code:
import sys

cnt = {}

for line in sys.stdin:
    for letter in line:
        if letter.isalpha():
            c = letter.lower()
            cnt[c] = cnt.get(c, 0)+1
            
for i in range(26):
    c = chr(ord("a")+i)
    print(c, ":", cnt.get(c, 0), sep=" ")

Submission status: Accepted

Solution code:
count=[0]*26
while True:
    try:
        s=input().lower()
        for i in s:
            if 96<ord(i)<124:
                count[ord(i)-97]+=1
    except:
        break
for i in range(26):
    print(f"{chr(i+97)} : {count[i]}")

Submission status: Accepted

Solution code:
# coding: utf-8
import sys
ans = {"a":0,"b":0,"c":0,"d":0,"e":0,"f":0,"g":0,"h":0,
    "i":0,"j":0,"k":0,"l":0,"m":0,"n":0,"o":0,"p":0,
    "q":0,"r":0,"s":0,"t":0,"u":0,"v":0,"w":0,"x":0,
    "y":0,"z":0}
lines = sys.stdin.readlines()
for line in lines:
    chars = list(line)
    for ch in chars:
        if ch == 'A' or ch =='a':
            ans["a"] += 1
        elif ch == 'B' or ch == 'b':
            ans["b"] += 1
        elif ch == 'C' or ch == 'c':
            ans["c"] += 1
        elif ch == 'D' or ch == 'd':
            ans["d"] += 1
        elif ch == 'E' or ch == 'e':
            ans["e"] += 1
        elif ch == 'F' or ch == 'f':
            ans["f"] += 1
        elif ch == 'G' or ch == 'g':
            ans["g"] += 1
        elif ch == 'H' or ch == 'h':
            ans["h"] += 1
        elif ch == 'I' or ch == 'i':
            ans["i"] += 1
        elif ch == 'J' or ch == 'j':
            ans["j"] += 1
        elif ch == 'K' or ch == 'k':
            ans["k"] += 1
        elif ch == 'L' or ch == 'l':
            ans["l"] += 1
        elif ch == 'M' or ch == 'm':
            ans["m"] += 1
        elif ch == 'N' or ch == 'n':
            ans["n"] += 1
        elif ch == 'O' or ch == 'o':
            ans["o"] += 1
        elif ch == 'P' or ch == 'p':
            ans["p"] += 1
        elif ch == 'Q' or ch == 'q':
            ans["q"] += 1
        elif ch == 'R' or ch == 'r':
            ans["r"] += 1
        elif ch == 'S' or ch == 's':
            ans["s"] += 1
        elif ch == 'T' or ch == 't':
            ans["t"] += 1
        elif ch == 'U' or ch == 'u':
            ans["u"] += 1
        elif ch == 'V' or ch == 'v':
            ans["v"] += 1
        elif ch == 'W' or ch == 'w':
            ans["w"] += 1
        elif ch == 'X' or ch == 'x':
            ans["x"] += 1
        elif ch == 'Y' or ch == 'y':
            ans["y"] += 1
        elif ch == 'Z' or ch == 'z':
            ans["z"] += 1

for al, count in ans.items():
    print(al + " : " + str(count))

Submission status: Accepted

Solution code:
from string import ascii_lowercase
from collections import defaultdict


dic = defaultdict(int)

    
while True:
    try:
        for st in input():
            dic[st.lower()] += 1
        

    except EOFError:
        break

for a in ascii_lowercase:
    print(f'{a} : {dic[a]}')

Submission status: Accepted

Solution code:
cnt = [0 for i in range(26)]
while True:
    try:
        s = input()
    except:
        break
    if s == '':
        break
    for cdfix in range(26):
        cnt[cdfix] += s.count(chr(ord('a') + cdfix))
        cnt[cdfix] += s.count(chr(ord('A') + cdfix))
for r in range(26):
    print('{} : {}'.format(chr(ord('a') + r), cnt[r]))

Submission status: Accepted

Solution code:
str = ""
upperStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
lowerStr = "abcdefghijklmnopqrstuvwxyz"
count = [0] * 26

while True:
        try:
                str += input()
        except:
                break

for n in range(len(str)):
        for i in range(26):
                if str[n] == upperStr[i] or str[n] == lowerStr[i]:
                        count[i] += 1
                        break

for i in range(26):
        print(lowerStr[i], ":", count[i])

Submission status: Accepted

Solution code:
sum = [0] * 26

sent = open(0).read()
for c in sent:
    if ord('a') <= ord(c) and ord(c) <= ord('z'):
        sum[ord(c) - ord('a')] += 1
    elif ord('A') <= ord(c) and ord(c) <= ord('Z'):
        sum[ord(c) - ord('A')] += 1

for x in range(26):
    print(chr(x + ord('a')), ":", sum[x])

Submission status: Accepted

Solution code:
import sys

string = 'abcdefghijklmnopqrstuvwxyz'
_list = []
for l in sys.stdin:
    _list.append(l)
for i in string:
    print(i + ' : ' + str(','.join(_list).lower().count(i)))

Submission status: Accepted

Solution code:
import sys

alphabet = {"a": 0, "b": 0, "c": 0, "d": 0, "e": 0, "f": 0, "g": 0, "h": 0, "i": 0, "j": 0, "k": 0, "l": 0, "m": 0,
            "n": 0, "o": 0, "p": 0, "q": 0, "r": 0, "s": 0, "t": 0, "u": 0, "v": 0, "w": 0, "x": 0, "y": 0, "z": 0}
text = sys.stdin.read().lower()
for character in text:
    if character.lower() in alphabet.keys():
        alphabet[character.lower()] += 1

for key in alphabet.keys():
    print("%s : %i" % (key, alphabet[key]))

Submission status: Accepted

Solution code:
s1 = ""
try:
	while True:
		t = input()
		if t == "":
			break
		s1 += t
except EOFError:
	pass
n = [0] * 26
s = s1.lower()
for i in range(len(s)):
	j = ord(s[i]) - 97
	if j >= 0 and j < 26:
		n[j] += 1
for i in range(26):
	print('%s : %d' %(chr(i + 97), n[i]))

Submission status: Accepted

Solution code:
import sys

ch = (chr(i) for i in range(97, 97+26))
sentence = sys.stdin.read().lower()
for c in ch:
    print(c, ':', sentence.count(c))

Submission status: Accepted

Solution code:
import sys

S = ""

while True:
    try:
        s = input()
        S += s.lower()
        if s == "":
            break
    except:
        break

dic = dict()

for c in S:
    dic[c] = dic[c] + 1 if c in dic else 1

for i in range(ord("z") - ord("a") + 1):
    c = chr(i + ord("a"))
    v = dic[c] if c in dic else 0

    print("{} : {}".format(c, v))

Submission status: Accepted

Solution code:
import sys
str = sys.stdin.read().lower()
for i in range(97, 97+26):
    print("%s : %s" % (chr(i), str.count(chr(i))))

Submission status: Accepted

Solution code:
import sys
 
s = ""
for line in sys.stdin:
    s+=line
s=s.lower()
for str in list("abcdefghijklmnopqrstuvwxyz"):
    print(*[str,":",s.count(str)])

Submission status: Accepted

Solution code:
alp = list("abcdefghijklmnopqrstuvwxyz")
ALP = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
tex = []
dic2 = dict(zip(ALP,alp))
while(1):
    try:
        t = list(input())
        tex.extend(t)
    except EOFError:
        break
dic = dict(zip(alp,[0 for i in range(26)]))
for i in tex:
    if i in alp:
        dic[i] += 1
    elif i in ALP:
        dic[dic2[i]] += 1
for i in alp:
    print("{} : {}".format(i,dic[i]))

Submission status: Accepted

Solution code:
countResultList = []
index = 0
inStrNum = 0
inStrLowList = []
inStr = str()
sample = 0
try:
    while True:
        sample +=1
        if inStrNum < 10 or sample < 1200:
            inStr = input()
            inStrLowList.append(inStr.lower())
            inStrNum += len(inStr)
        else:
            break
except EOFError:
    pass
inStrLow = str(inStrLowList)
for alphabet in range(ord("a"),ord("z")+1):
    countResultList.append(inStrLow.count(chr(alphabet)))
    index += 1
indexOrder = 0
for alphabet in range(ord("a"),ord("z")+1):
    print("%s : %s"%(chr(alphabet),countResultList[indexOrder]))
    indexOrder += 1

Submission status: Accepted

Solution code:
import sys
from collections import Counter
c=Counter(sys.stdin.read().lower())
for i in [chr(ord('a') + i) for i in range(26)]:
    print('{} : {}'.format(i,c[i]))

Submission status: Accepted

Solution code:
import sys

occurrences = [0] * 26

for c in sys.stdin.read():
    al = c.lower()
    if 'a' <= al <= 'z':
        occurrences[ord(al) - ord('a')] += 1

for i, oc in enumerate(occurrences):
    print(f"{chr(ord('a') + i)} : {oc}")

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys
from string import ascii_lowercase
from collections import Counter

in_lines = ''.join(sys.stdin.readlines())
counts = Counter(in_lines.lower())

for key in ascii_lowercase:
    print(key, ':', counts[key])

Submission status: Accepted

Solution code:
alphabet=list("abcdefghijklmnopqrstuvwxyz")
bun=""
while 1:
    try:
        string=input().lower()
        bun+=str(string)
    except:
        break
    
for i in range(len(alphabet)):
    alp=alphabet[i]
    print(alp,":",bun.count(alp))

Submission status: Accepted

Solution code:
def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

s = list(get_input())

d = {char:0 for char in [chr(ord('a')+i) for i in range(26)]}
for line in s:
    for x in line.lower():
        if(x in d):
            d[x] += 1

for k in d:
    print(k + " : " + str(d[k]))

Submission status: Accepted

Solution code:
import sys
import string

sentence = sys.stdin.read().lower()
for c in string.ascii_lowercase:
    print('{} : {}'.format(c, sentence.count(c)))

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict
alphabets = defaultdict(int)
lines = sys.stdin.readlines()
for line in lines:
    for ch in line.rstrip():
        if ch.isalpha():
            ch = ch.lower()
            alphabets[ch] += 1

for i in range(26):
    ch = chr(ord('a')+i)
    print(f'{ch} : {alphabets[ch]}')

Submission status: Accepted

Solution code:
import sys;s=sys.stdin.read().lower()
for c in map(chr,range(97,123)):print(c,':',s.count(c))

Submission status: Accepted

Solution code:
alpha = "abcdefghijklmnopqrstuvwxyz"
t = ""
while True:
    try:
        n  =  str(input()).lower()
    except EOFError:
        break
    t = t + n

for i in alpha:
    print (i,":",t.count(i))

Submission status: Accepted

Solution code:
import collections
import sys
def countString (str):
    alphalist = [chr(ord('a') + i) for i in range(26)] # ['a', 'b', 'c', ... , 'z']
    strlist = list(str.lower())
    c = collections.Counter(strlist)
    for s in alphalist:
        print('{0} : {1}'.format(s, c[s]))

if __name__ == '__main__':
    mojiretsu = ""
    for line in sys.stdin:
        mojiretsu += line
    countString(mojiretsu)

Submission status: Accepted

Solution code:
import sys
l=sys.stdin.read().lower()
a=list("abcdefghijklmnopqrstuvwxyz")
for item in a:
    print(item,":",l.count(item))

Submission status: Accepted

Solution code:
alpha = "abcdefghijklmnopqrstuvwxyz"
string = ""
a = input().strip().lower()
try:
    while len(a) > 0:
        string +=a
        a = input().strip().lower()
except:
    pass

word_l = dict()
for a in alpha:
    word_l[a] = 0
for i in string: 
    if i in word_l:
        word_l[i] += 1
for val,ind in word_l.items():
    print("{} : {}".format(val,ind ))

Submission status: Accepted

Solution code:
import sys

a_to_z = [chr(i) for i in range(ord('a'),ord('z')+1)]
s = sys.stdin.read()
lower_s = s.lower()

for chr in a_to_z:
    print('{} : {}'.format(chr,lower_s.count(chr)))

Submission status: Accepted

Solution code:
from collections import Counter
x="abcdefghijklmnopqrstuvwxyz"
X=list(x)
let=[]
while(1):
    try:
        A=input().split()
    except EOFError:
        break
    A="".join(A)
    let.append(A)
Let="".join(let)
Let=Let.lower()
count=Counter(Let)
for st in X:
    print(f"{st} : {count[st]}")

Submission status: Accepted

Solution code:
alphabet = [chr(i) for i in range(ord("a"), ord("z")+1)]
import collections
alphabet_d = collections.OrderedDict()
for a in alphabet:
    alphabet_d[a] = 0

import sys
S = sys.stdin.readlines()
for s in S:
    sl = s.lower()
    for c in sl:
        if c in alphabet:
            alphabet_d[c] += 1
for k, v in alphabet_d.items():
    print("{0} : {1}".format(k, v))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
# ITP1_8_C
import sys


alphabet={chr(i) : 0 for i in range(97, 97+26)}
R=""
for text in sys.stdin:
    R += text.lower()
    
for j in R:
    if j in alphabet:
        alphabet[j] += 1

for alpha in sorted(alphabet.items(), key = lambda x: x[0]):
    print(" : ".join(list(map(str,alpha))))

Submission status: Accepted

Solution code:
from sys import stdin

cnt = {}
for line in stdin:
    for c in line:
        d = chr(ord(c)|0x20)
        if 'a'<=d<='z':
            cnt[d] = cnt.get(d, 0) + 1

for i in range(ord('z')-ord('a')+1):
    c = chr(ord('a')+i)
    print(c, ':', cnt.get(c, 0))

Submission status: Accepted

Solution code:
import sys

strn = []
for s in sys.stdin:
    strn.append(s)

strng = ''.join(strn).lower()

a = 'abcdefghijklmnopqrstuvwxyz'

strng_lower = strng.lower()

for i in range(26):
    print("{} : {}".format(a[i], strng_lower.count(a[i])))