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:
import sys
alpha = (chr(i) for i in range(97, 97+26))
l = []
for line in sys.stdin:
    l += line.lower()
count = {a:l.count(a) for a in alpha}
for k in sorted(count):
    print('%c : %i' % (k, count[k]))

Submission status: Accepted

Solution code:
chars = ""
while True:
	try:
		chars += raw_input()
	except EOFError:
		break

#chars = raw_input()
low_chars = chars.lower()
#print low_chars

alphabet = "abcdefghijklmnopqrstuvwxyz"

for c in alphabet:
	cnt = low_chars.count(c)
	print("{:} : {:}".format(c, cnt))

Submission status: Accepted

Solution code:
# coding: utf-8
alphabet = 'abcdefghijklmnopqrstuvwxyz'
S = ''
while True:
    try:
        n = input()
        S += n
    except EOFError:
        break
ans_dict = {}
for char in alphabet:
    ans_dict[char] = S.count(char)
    ans_dict[char] += S.count(char.upper())
for k, v in sorted(ans_dict.items(), key=lambda x: x[0]):
    print('{} : {}'.format(k, v))

Submission status: Accepted

Solution code:
def main():

    alphabets_table = [0 for i in range(26)]

    while True:
        try:
            input_string = input()
            lower_string = input_string.lower()
            for i, _letter in enumerate("abcdefghijklmnopqrstuvwxyz"):
                alphabets_table[i] += lower_string.count(_letter)
        except EOFError:
            break
            
    for i, _letter in enumerate("abcdefghijklmnopqrstuvwxyz"):
        print('%s : %s' % (_letter, alphabets_table[i]))


main()

Submission status: Accepted

Solution code:
a=ord('a')
rdif=range(ord('z')-a+1)
l=[0 for _ in rdif]
s=''
while True:
    try: s+=input().lower()
    except: break    
for i in range(len(s)):
    if s[i].isalpha(): l[ord(s[i])-a]+=1
for i in rdif:
    print(chr(i+a),':',l[i])

Submission status: Accepted

Solution code:
import sys

alphabets = 'abcdefghijklmnopqrstuvwxyz'

cnt = {}
for c in alphabets:
    cnt[c] = 0

for line in sys.stdin:
    for c in line:
        if 'a' <= c.lower() <= 'z':
            cnt[c.lower()] += 1

for c in alphabets:
    print('%s : %d' % (c, cnt[c]) )

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_8_C&lang=jp

"""
import sys
from sys import stdin
from collections import defaultdict
input = stdin.readline


def main(args):
    word = defaultdict(int)
    for line in sys.stdin:
        line = line.strip()
        for c in line:
            if c.isalpha():
                c = c.lower()
                word[c] += 1

    for c in 'abcdefghijklmnopqrstuvwxyz':
        print('{} : {}'.format(c, word[c]))


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
import sys

alpha = 'abcdefghijklmnopqrstuvwxyz'
m = {k:0 for k in alpha}
q = ''
for line in sys.stdin:
    q += line

for s in q:
    s = s.lower()
    if s in m:
        m[s] += 1
    
for s in alpha:
    print('%s : %d' % (s, m[s]))

Submission status: Accepted

Solution code:
# Belongs to : midandfeed aka asilentvoice
import string
s = ""
while(1):
	try:
		s += str(input()).lower()
	except:
		break
		
alphabet = string.ascii_lowercase
ans = [0]*26
for x in s:	
	if x in alphabet:
		ans[ ord(x)-ord('a') ] += 1

for i in range(len(ans)):
	print("{} : {}".format(chr(i+ord('a')), ans[i]))

Submission status: Accepted

Solution code:
import sys
num = [0 for i in range(26)]
for str in sys.stdin:
    st=str.lower()
    for k in range(len(st)):
        if ord(st[k])<=122 and ord(st[k])>=97:
            num[ord(st[k])-97]+=1
for i in range(26):
    print("{0} : {1}".format(chr(i+97),num[i]))

Submission status: Accepted

Solution code:
import sys
s=str()
x="abcdefghijklmnopqrstuvwxyz"
for a in sys.stdin:s+=a.lower()
for c in x:print(c+" : "+str(s.count(c)))

Submission status: Accepted

Solution code:
import sys
import string
from collections import Counter


def main():
    s = sys.stdin.read()
    c = Counter(s.lower())

    for char in string.ascii_lowercase:
        print(char, ":", c.get(char, 0))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a=""
while 1:
 try:a+=input().lower()
 except:break
[print(chr(97+i),':',a.count(chr(97+i)))for i in range(26)]

Submission status: Accepted

Solution code:
import sys
s=sys.stdin.read().lower()
[print(chr(i),':',s.count(chr(i)))for i in range(97,123)]

Submission status: Accepted

Solution code:
alpha = [chr(i) for i in range(97, 97+26)]

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

for i in s:
    if i.lower() in alpha:
        alpha.append(i.lower())
        
for i in alpha[:26]:
    print(str(i) + " : " + str(alpha.count(i) - 1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
wordcount = ""
while True:
    try:
        words = input()
        wordcount = wordcount + words.lower()
    except:
        break    
for i in [chr(i) for i in range(97,97+26)]:
    print('{0} : {1}'.format(i,wordcount.count(i)))

Submission status: Accepted

Solution code:
S = ""
while 1:
	try:
		s = raw_input()
	except:
		break
	S += s.lower()

for i in range(ord('a'), ord('z')+1):
	print '%s : %d' %(chr(i), S.count(chr(i)))

Submission status: Accepted

Solution code:
import sys

d = { chr(i): 0 for i in range(97, 123) }
s = [i for i in sys.stdin]
for i in s:
    i = list(i)
    for c in i:
        try: 
            d[c.lower()] += 1
        except:
            continue
for i,j in d.items():
    print('{} : {}'.format(i,j))

Submission status: Accepted

Solution code:
import sys

a = ""
for input in sys.stdin:
    a += input.lower()
for i in range(97,123):
    print "%c : %d"%(chr(i),a.count(chr(i)))

Submission status: Accepted

Solution code:
import sys

alnum = ord('z') - ord('a') + 1
res = [0] * alnum

for line in sys.stdin:
    instr = line.lower()

    for s in instr:
        if s.isalpha():
            relc = ord(s) - ord('a')
            res[relc] += 1

for i in range(alnum):
    print("{0} : {1}".format(chr(i + ord('a')), res[i]))

Submission status: Accepted

Solution code:
import sys
from collections import Counter
S = ""
for s in sys.stdin:
    s = s.strip().lower()
    if not s:
        break
    S += s
for i in 'abcdefghijklmnopqrstuvwxyz':
    print(i, ":", S.count(i))

Submission status: Accepted

Solution code:
import sys
from collections import Counter
m = Counter(sys.stdin.read().lower())
for i in 'abcdefghijklmnopqrstuvwxyz':
    print(i, ":", m[i])

Submission status: Accepted

Solution code:
import sys
S= sys.stdin.read()
print('a : '+str(S.count('a')+S.count('A')))
print('b : '+str(S.count('b')+S.count('B')))
print('c : '+str(S.count('c')+S.count('C')))
print('d : '+str(S.count('d')+S.count('D')))
print('e : '+str(S.count('e')+S.count('E')))
print('f : '+str(S.count('f')+S.count('F')))
print('g : '+str(S.count('g')+S.count('G')))
print('h : '+str(S.count('h')+S.count('H')))
print('i : '+str(S.count('i')+S.count('I')))
print('j : '+str(S.count('j')+S.count('J')))
print('k : '+str(S.count('k')+S.count('K')))
print('l : '+str(S.count('l')+S.count('L')))
print('m : '+str(S.count('m')+S.count('M')))
print('n : '+str(S.count('n')+S.count('N')))
print('o : '+str(S.count('o')+S.count('O')))
print('p : '+str(S.count('p')+S.count('P')))
print('q : '+str(S.count('q')+S.count('Q')))
print('r : '+str(S.count('r')+S.count('R')))
print('s : '+str(S.count('s')+S.count('S')))
print('t : '+str(S.count('t')+S.count('T')))
print('u : '+str(S.count('u')+S.count('U')))
print('v : '+str(S.count('v')+S.count('V')))
print('w : '+str(S.count('w')+S.count('W')))
print('x : '+str(S.count('x')+S.count('X')))
print('y : '+str(S.count('y')+S.count('Y')))
print('z : '+str(S.count('z')+S.count('Z')))

Submission status: Accepted

Solution code:
import sys
import string


def main():
    tmp = ''

    try:
        while True:
            tmp += input()
    except EOFError:
        pass

    tmp = list(filter(lambda x: x in string.ascii_lowercase, tmp.lower()))

    for c in string.ascii_lowercase:
        print('{} : {}'.format(c, tmp.count(c)))

    return 0


if __name__ == '__main__':
    sys.exit(main())

Submission status: Accepted

Solution code:
# coding:utf-8
import sys
a = []
for line in sys.stdin:
    a.append(list(line.strip().replace(" ","").lower()))
a = reduce(lambda x,y: x+y,a)
dict = {}
for i in range(26):
    dict[chr(ord('a')+i)] = 0
for i in a:
    for key,value in dict.items():
        if key == i:
            dict[key] += 1
for key,value in sorted(dict.items()):
    print "%s : %d" % (key,value)

Submission status: Accepted

Solution code:
alpha = 'abcdefghijklmnopqrstuvwxyz'
text = ''

while True:
    try:
        text += input().lower()
    except EOFError:
        break

for a in alpha:
    print('{} : {}'.format(a, text.count(a)))

Submission status: Accepted

Solution code:
# coding: UTF-8
alfa_list = [chr(i) for i in range(97, 97+26)]
lines = []
count = 0
while(1):
    try:
        lines.append(str(raw_input()).lower())
    except:
        break
for ch in alfa_list:
    print "{0} : {1}".format(alfa_list[count],str(lines).count(ch))
    count += 1

Submission status: Accepted

Solution code:
import sys
hoge = { chr(x):0 for x in range(ord('a'), ord('z')+1)}
a = list()
for line in sys.stdin:
    a.append(line)
for line in a:
    for x in line:
        if x.lower() not in hoge:
            continue
        else:
            hoge[x.lower()] += 1
for k, v in sorted(hoge.items()):
    print ('{} : {}'.format(k, v))

Submission status: Accepted

Solution code:
import sys

char_list = []
for line in sys.stdin:
    char_list.append([j for j in line.lower()])
char_dict = {i:0 for i in "abcdefghijklmnopqrstuvwxyz"}
for i in range(len(char_list)):
    for j in char_list[i]:
        if j in char_dict:
            char_dict[j] += 1
for i in char_dict:
    print(i+" : {0}".format(char_dict[i]))

Submission status: Accepted

Solution code:
from sys import stdin
freq = {}
for line in stdin:
    string = line.lower()

    for i in string:
        if i.isalpha():
            freq[i] = freq.get(i, 0) + 1

for char in range(ord('a'), ord('z')+1):
    char = chr(char)
    print('%s : %d' % (char, freq.get(char, 0)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

cc = ['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']
c  = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

while True:
  s = sys.stdin.readline().rstrip('\r\n')
  if s == '':
    break

  for ii in range(len(s)):
    test = s[ii].lower()
    for jj in range(len(cc)):
      if test == cc[jj]:
        c[jj] += 1

for ii in range(len(cc)):
  print(cc[ii] +  ' : ' + str(c[ii]))

Submission status: Accepted

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

import sys
import string

alphabet = string.ascii_lowercase
char_count = dict()
for c in alphabet:
    char_count[c] = 0

for s in sys.stdin:
    s = s.strip().lower()
    for c in s:
        if c in alphabet:
            char_count[c] += 1

for c in alphabet:
    print(c, ':', char_count[c])

Submission status: Accepted

Solution code:
alist = list('abcdefghijklmnopqrstuvwxyz')
r = {}
for al in alist:
    r[al] = 0

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

for i in range(len(line)):
    if line[i] in r.keys():
        r[line[i]] += 1

for k,v in r.items():
    print("{} : {}".format(k, v))

Submission status: Accepted

Solution code:
import sys

alist = list('abcdefghijklmnopqrstuvwxyz')
r = {}
for al in alist:
    r[al] = 0

line = sys.stdin.read().lower()

for i in range(len(line)):
    if line[i] in r.keys():
        r[line[i]] += 1

for k,v in r.items():
    print("{} : {}".format(k, v))

Submission status: Accepted

Solution code:
import sys
cs = { c : 0 for c in list("abcdefghijklmnopqrstuvwxyz")}
for c in list(sys.stdin.read()):
    c = c.lower()
    if c in cs.keys():
        cs[c] = cs[c] + 1
for (c,cnt) in sorted(list(cs.items())):
    print('{0} : {1}'.format(c,cnt))

Submission status: Accepted

Solution code:
import sys
lines = sys.stdin.readlines()
cnt = [0 for i in range(26)]
for line in lines:
    line = line.lower()
    alph = [chr(ord('a') + i) for i in range(26)]
    for idx, i in enumerate(alph):
        for k in line:
            if i == k:
                cnt[idx] += 1
for idx, i in enumerate(alph):
    print("{0} : {1}".format(i, cnt[idx]))

Submission status: Accepted

Solution code:
import sys
lines = sys.stdin.readlines()
cnt = [0 for i in range(26)]
alph = [chr(ord('a') + i) for i in range(26)]
for line in lines:
    line = line.lower()
    for idx, i in enumerate(alph):
        for k in line:
            if i == k:
                cnt[idx] += 1
for idx, i in enumerate(alph):
    print("{0} : {1}".format(i, cnt[idx]))

Submission status: Accepted

Solution code:
import sys
letters = 'abcdefghijklmnopqrstuvwxyz'
s = sys.stdin.read().lower()
for i in range(26) :
    print(letters[i] + ' : %d' % s.count(letters[i]))

Submission status: Accepted

Solution code:
import sys

inLine = []
strings = []
for line in sys.stdin:
    for i in range(len(list(str(line).lower()))):
        strings.append(list(str(line).lower())[i])
arr = []
for i in range(26):
    arr.append(0)

for i in range(len(strings)):
    if ord(strings[i]) >= 97 and ord(strings[i]) <= 122:
        arr[ord(strings[i]) - 97] += 1

for i in range(97,123):
    print(chr(i) + " : "  + str(arr[i - 97]))

Submission status: Accepted

Solution code:
import string
from collections import Counter


def count(s):
    """Count the occurence of each alphabet chars.
    The count is done case insensitively.

    >>> count('A:a b')  # doctest: +NORMALIZE_WHITESPACE
    Counter({'a': 2, 'b': 1})
    """
    return Counter([c for c in s.lower() if c.isalpha()])


def run():
    s = ''
    while True:
        try:
            s += input()
        except EOFError:
            break

    c = count(s)
    for a in string.ascii_lowercase:
        print(a, ':', c[a])


if __name__ == '__main__':
    run()

Submission status: Accepted

Solution code:
import sys
alphabet = "abcdefghijklmnopqrstuvwxyz"
sentence = sys.stdin.read()

for letter in alphabet:
    print(letter, ":", sentence.lower().count(letter))

Submission status: Accepted

Solution code:
#coding: utf-8
import sys
c = [0 for i in range(26)]
in_list = []

for line in sys.stdin:
    in_list.append(line)

for s in in_list:
    for i in range(len(s)):
        if   ord(s[i]) >= ord('a') and ord(s[i]) <= ord('z'):
            c[ord(s[i])-97] += 1
        elif ord(s[i]) >= ord('A') and ord(s[i]) <= ord('Z'):
            c[ord(s[i])-65] += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, string
 
lines = []
for line in sys.stdin:
    lines.append(line)
 
text = ''.join(lines).lower()
     
for char in string.ascii_lowercase:
    print("{} : {}".format(char, text.count(char)))

Submission status: Accepted

Solution code:
import string as st
string=[]
try:
    while True:
        s = input()#入力
        string =list(string)#list変換
        if not s :#空入力のときループぬける
            break
        string.extend(s)#list追加
        string=map(str,string)
        string="".join(string).lower()#str型変換と小文字
except EOFError:
    for i in range(len(st.ascii_lowercase)):
        print("{} : {}".format(st.ascii_lowercase[i],string.count(st.ascii_lowercase[i])))

Submission status: Accepted

Solution code:
from collections import OrderedDict as od
 
  
dic = od()
for s in "abcdefghijklmnopqrstuvwxyz":
    dic[s] = 0
 
x = ""
while True:  
    try:  
        x += input().lower()
    except EOFError:
        break
 
for key,value in dic.items():
    value = x.count(key)
    print(key, ":", value)

Submission status: Accepted

Solution code:
cnt = [0 for i in range(26)]
while True:
      try:
            s = input()
      except:
            break
      for i in range(len(s)):
            m = ord(s[i])-ord('A')
            if(m >= 0 and m < 26):
                  cnt[m]+=1
            m = ord(s[i])-ord('a')
            if(m >= 0 and m < 26):
                  cnt[m]+=1
for i in range(26):
      print(chr(i+ord('a')),":",cnt[i])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys

word = sys.stdin.read().lower()
for i in range(ord('a'), ord('z') + 1):
    print('{0} : {1}'.format(chr(i), word.count(chr(i))))

Submission status: Accepted

Solution code:
import sys
def lower(word):
    Word = ''
    str = list(word)
    for i in range(len(str)):
        if str[i].isupper(): Word += str[i].lower()
        else: Word += str[i]
    return Word
a = []
for line in sys.stdin:
    a.extend(list(line))


count = [0] * 26
for i in range(len(a)):
    a[i] = lower(a[i])
    if 97 <= ord(a[i]) and ord(a[i]) < 123:
        count[ord(a[i]) - 97] += 1
for i in range(26):
    print(chr(i + 97) + ' : ' + str(count[i]))

Submission status: Accepted

Solution code:
#! python3
# counting_characters.py

import sys

sents = [line.strip() for line in sys.stdin.readlines()]
dic = {chr(x):0 for x in range(ord('a'), ord('z')+1)}

for sent in sents:
    for c in sent:
        x = c.lower()
        if ord('a') <= ord(x) and ord(x) <= ord('z'):
            dic[x] += 1

for k, v in dic.items():
    print(k + ' : ' + str(v))

Submission status: Accepted

Solution code:
import sys
A = sys.stdin.read().lower()
Dir = {
'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
}
for a in A:
	if a in Dir:
		Dir[a] += 1
for i in Dir:
	print(i,':',Dir[i])

Submission status: Accepted

Solution code:
import sys
 
cnt = {}
 
for line in sys.stdin:
  for l in line:
    if l.isalpha():
      c = l.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:
import sys

cnt = {}

for line in sys.stdin:
    for c in line:
        if c.isalpha():
            cl = c.lower()
            cnt[cl] = cnt.get(cl, 0) + 1

for i in range(97, 97 + 26):
    c = chr(i)
    print("{0} : {1}".format(c, cnt.get(c, 0)))

Submission status: Accepted

Solution code:
import sys, string
 
lines = []
for line in sys.stdin:
    lines.append(line)
 
text = ''.join(lines).lower()
     
for char in string.ascii_lowercase:
    print("{} : {}".format(char, text.count(char)))

Submission status: Accepted

Solution code:
import sys

table = "abcdefghijklmnopqrstuvwxyz"

sentence = sys.stdin.read()
sentence1 = sentence.lower()
for i in table:
    print(i + ' : ' + str(sentence1.count(i)))

Submission status: Accepted

Solution code:
alphabet = [0]*26
i = 0;
for j in range(97,123):
    alphabet[i] = chr(j)
    i += 1
al_count = [0]*26
while True :
    try :
        words = raw_input().lower().split()
        for k in words :
            for l in list(k):
                if l=='a':
                    al_count[0] += 1
                elif l=='b':
                    al_count[1] += 1
                elif l=='c':
                    al_count[2]+=1  
                elif l=='d':
                    al_count[3] += 1
                elif l=='e':
                    al_count[4]+=1
                elif l=='f':
                    al_count[5] += 1
                elif l=='g':
                    al_count[6]+=1
                elif l=='h':
                    al_count[7] += 1
                elif l=='i':
                    al_count[8]+=1
                elif l=='j':
                    al_count[9] += 1
                elif l=='k':
                    al_count[10]+=1 
                elif l=='l':
                    al_count[11] += 1
                elif l=='m':
                    al_count[12]+=1 
                elif l=='n':
                    al_count[13] += 1
                elif l=='o':
                    al_count[14]+=1
                elif l=='p':
                    al_count[15] += 1
                elif l=='q':
                    al_count[16]+=1
                elif l=='r':
                    al_count[17] += 1
                elif l=='s':
                    al_count[18]+=1
                elif l=='t':
                    al_count[19] += 1
                elif l=='u':
                    al_count[20]+=1
                elif l=='v':
                    al_count[21]+=1
                elif l=='w':
                    al_count[22] += 1
                elif l=='x':
                    al_count[23]+=1
                elif l=='y':
                    al_count[24] += 1
                elif l=='z':
                    al_count[25]+=1
    except :
        break
for i in range(26):
    print '%c : %d' %(alphabet[i],al_count[i])

Submission status: Accepted

Solution code:
import string, sys
sen = sys.stdin.read().lower()

char_dic = {i:0 for i in string.ascii_lowercase}

for j in sen:
    if j in char_dic:
        char_dic[j] += 1

for k in string.ascii_lowercase:
    print("{} : {}".format(k, char_dic[k]))

Submission status: Accepted

Solution code:
d = {}
while 1:
    try:
        se = input().lower()
    except:
        break
    for i in se:
        if i.isalpha():
            d[i] = d.get(i, 0) + 1
for i in 'abcdefghijklmnopqrstuvwxyz':
    d[i] = d.get(i, 0)
    print("{} : {}".format(i, d[i]))

Submission status: Accepted

Solution code:
a=''
while True:
    try:
        str = input().lower()
        a+=str
    except:
        break
for i in range(97, 97 + 26):
    count = 0
    for j in a:
        if chr(i) == j:
            count += 1
    print(chr(i), ':', count)

Submission status: Accepted

Solution code:
import sys
count = [0 for _ in range(ord("a"), ord("z") + 1)]
for line in sys.stdin:
    for c in list(line.lower()):
        if "a" <= c <= "z":
            count[ord(c) - ord("a")] += 1
for i, n in enumerate(count):
    print("{ch} : {cnt}".format(ch = chr(ord("a") + i), cnt = n))

Submission status: Accepted

Solution code:
count = [0 for _ in range(ord("a"), ord("z") + 1)]
while True:
    try:
        for c in list(input().lower()):
            if "a" <= c <= "z":
                count[ord(c) - ord("a")] += 1
    except EOFError:
        break
for i, n in enumerate(count):
    print("{ch} : {cnt}".format(ch = chr(ord("a") + i), cnt = n))

Submission status: Accepted

Solution code:
import fileinput
a_dict = {chr(c): 0 for c in range(97, 123)}
for line in fileinput.input():
    line = line.lower()
    for c in line:
        if c in a_dict:
            a_dict[c] += 1

for k, v in a_dict.items():
    print('{0} : {1}'.format(k, v))

Submission status: Accepted

Solution code:
# AOJ ITP1_8_C

import sys

def numinput():
    a = input().split()
    for i in range(len(a)):
        a[i] = int(a[i])
    return a

def main():
    counts = []
    for i in range(26): counts.append(0)

    lines = sys.stdin.readlines()

    for i in range(len(lines)):
        string = lines[i]
        # if not len(string): break   # 長さが0のstringが来たら終了
        for k in range(len(string)):
            c = string[k]
            if 97 <= ord(c) <= 122:
                counts[ord(c) - 97] += 1
            elif 65 <= ord(c) <= 90:
                counts[ord(c) - 65] += 1

    # 結果を出力。
    for i in range(26):
        print(chr(97 + i) + " : " + str(counts[i]))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# AOJ ITP1_8_C

import sys

def main():
    counts = []
    for i in range(26): counts.append(0)

    lines = sys.stdin.readlines()

    for i in range(len(lines)):
        string = lines[i]
        for k in range(len(string)):
            c = string[k]
            if 97 <= ord(c) <= 122:
                counts[ord(c) - 97] += 1
            elif 65 <= ord(c) <= 90:
                counts[ord(c) - 65] += 1

    # 結果を出力。
    for i in range(26):
        print(chr(97 + i) + " : " + str(counts[i]))

if __name__ == "__main__":
    main()

# Accepted.

Submission status: Accepted

Solution code:
import sys
l=[0]*26
for h in sys.stdin:
    for i in h:
        k=ord(i.lower())
        if 96<k<123:l[k-97]+=1
for i in range(26):print chr(i+97),':',l[i]

Submission status: Accepted

Solution code:
import fileinput

d = {chr(k) : 0 for k in range(97, 123)}
for line in fileinput.input():
    for c in line.lower():
        if c in d:
            d[c] += 1

for k, v in d.items():
    print("{0} : {1}".format(k, v))

Submission status: Accepted

Solution code:
import sys
counts = [0] * 26

s = sys.stdin.read()
	
for c in s:
	o = ord(c)
	if o >= 65 and o <= 90:
		counts[o - 65] += 1
	elif o >= 97 and o <= 122:
		counts[o - 97] += 1
	
for i in range(len(counts)):
	print(chr(i + 97) + ' : ' + str(counts[i]))

Submission status: Accepted

Solution code:
s = ""
while True:
    try:
        s += input()
    except EOFError:
        break
s = s.lower()
d = dict()
for c in "abcdefghijklmnopqrstuvwxyz":
    d[c] = 0
for c in s:
    if c in "abcdefghijklmnopqrstuvwxyz":
        d[c] += 1
for c in "abcdefghijklmnopqrstuvwxyz":
    print(f"{c} : {d[c]}")

Submission status: Accepted

Solution code:
import sys

inp = sys.stdin
counter = {}

for text in inp:
    for a in text:
        a = a.lower()
        counter[a] = counter.get(a,0) + 1

for x in range(26):
    a = chr(ord('a')+x)
    print("{0} : {1}".format(a,counter.get(a,0)),sep='')

Submission status: Accepted

Solution code:
all_text = []
while True:
    try:
        text = input().split()
        all_text.extend(text)
    except EOFError:
        break
text = ''.join(all_text)

count = [0]*32
for letter in text:
    i = ord(letter)
    if i < 64:
        continue
    else:
        i %= 32
    if i:
        count[i] += 1

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

Submission status: Accepted

Solution code:
# Counting Characters
import sys

charList = list('abcdefghijklmnopqrstuvwxyz')
lines = sys.stdin.readlines()
combinedLine = ""
for line in lines:
    line = line.strip("\n").lower()
    combinedLine += line
totalSentence = list(combinedLine)
# print(totalSentence)

for char in charList:
    count = 0
    for i in range(len(totalSentence)):
        if totalSentence[i] == char:
            count += 1
    print(char + ' : ' + str(count))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import string
c = {}
while True:
    try:
        for x in raw_input().lower():
            if not x.isalpha():
                continue
            c[x] = c.get(x, 0) + 1
    except EOFError, e:
        break

for x in string.ascii_lowercase:
    print("%s : %d" % (x, c.get(x, 0)))

Submission status: Accepted

Solution code:
import sys

x = [0 for i in range(26)]
c0 = 97
for line in sys.stdin:
    for c in line.strip('\n').lower():
        if 'a' <= c and c <= 'z':
            x[ord(c)-c0] += 1

for i in range(26):
    print '%s : %d' %(chr(i + c0), x[i])

Submission status: Accepted

Solution code:
s = []
while True:
    try: 
        x = raw_input()
    except:
        break
    s.append(x.lower())
s = ''.join(s)

for i in range(26):
    c = chr(i + 97)
    print '%s : %d' %(c, s.count(c))

Submission status: Accepted

Solution code:
c=[0]*26
while 1:
        try:
                t=list(raw_input().lower())
                for i in range(len(t)):
                        if 0<=ord(t[i])-ord("a")<=25:
                                c[ord(t[i])-ord("a")]+=1
        except EOFError:
                break
for i in range(26):
        print chr(ord("a")+i),":",c[i]

Submission status: Accepted

Solution code:
from __future__ import division, print_function
from sys import stdin
cnt = [0] * 127
for c in stdin.read().lower():
    cnt[ord(c)] += 1
for i in range(ord('a'), ord('z')+1):
    print(chr(i), ':', cnt[i])

Submission status: Accepted

Solution code:
import time
import sys
import io
import re
import math
#start = time.clock()
i = [0]*127
#n = raw_input()
for x in sys.stdin.read().lower():
    i[ord(x)]+=1
for y in range(ord('a'), ord('z')+1):
    print chr(y)+ ' : ' + str(i[y])

Submission status: Accepted

Solution code:
import sys
dic = [['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]]  
for s in sys.stdin.read().lower():
	if s == '':
		break
	for i in s:
		for j in range(0, 26):
			if dic[j][0] == i.lower():
				dic[j][1] += 1
				break
for i in range(0, 26):
	print dic[i][0], ':', dic[i][1]

Submission status: Accepted

Solution code:
b = [0]*26
while True:
    try: 
        a = raw_input()
        for i in a:
            c = ord(i.lower())
            if c>= ord("a") and c <= ord("z"):
                b[c-ord("a")] +=1
    except EOFError,e:
        break
for i,v in enumerate(b):
    print "{0} : {1}".format(chr(i+ord("a")),v)

Submission status: Accepted

Solution code:
import sys
az =["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"]
sum_az = [0 for x in range(26)]

for x in sys.stdin.read().lower():
    for i in range(26):
        for j in range(len(x)):
            if x[j] == az[i]:
                sum_az[i] += 1


for i in range(26):
    print ("%s : %d" % (az[i], sum_az[i]))

Submission status: Accepted

Solution code:
import sys
az =["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"]
sum_az = [0 for x in range(26)]

for x in sys.stdin.read().lower():
    for i in range(26):
        if x == az[i]:
            sum_az[i] += 1


for i in range(26):
    print ("%s : %d" % (az[i], sum_az[i]))

Submission status: Accepted

Solution code:
text = ""
ans = [0 for i in range(26)]
while True:
	try:
		text += raw_input().lower()
	except:
		for s in text:
			if s.isalpha():
				ans[ord(s)-97] += 1
		for j in range(len(ans)):
			print "{} : {}".format(chr(j+97),ans[j])
		break

Submission status: Accepted

Solution code:
s = ''
while True:
    try:
        s += input().lower()
    except EOFError:
        break

for c in 'abcdefghijklmnopqrstuvwxyz':
    print('{} : {}'.format(c, s.count(c)))