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
dic={}
for alp in [chr(i) for i in range(ord('a'), ord('z')+1)]:
    dic[alp]=0
s=sys.stdin.read()
for m in s:
    if m.isalpha():
        if m.isupper()==True:
            m_=m.lower()
            dic[m_]+=1
        else:
            dic[m]+=1
for k in dic:
    print("{} : {}".format(k,dic[k]))

Submission status: Accepted

Solution code:
import sys

count = [0]*26
lines = sys.stdin.readlines()

for line in lines:
    for c in line.lower():
        if 97 <= ord(c) <= 123:
            count[ord(c) - 97] += 1
            
for i in range(26):
    print(chr(i + 97), ':', count[i])

Submission status: Accepted

Solution code:
import sys
lstlet = ["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"]
lstint = [0] * 26
moji = ""
while True:
  try:
    moji = moji + str(input())
  except:
    break;
lstin = list(moji)
length = len(lstin)
for i in range(length):
  if str(lstin[i]) == "a" or str(lstin[i]) == "A":
    lstint[0] += 1
  elif str(lstin[i]) == "b" or str(lstin[i]) == "B":
    lstint[1] += 1
  elif str(lstin[i]) == "c" or str(lstin[i]) == "C":
    lstint[2] += 1
  elif str(lstin[i]) == "d" or str(lstin[i]) == "D":
    lstint[3] += 1
  elif str(lstin[i]) == "e" or str(lstin[i]) == "E":
    lstint[4] += 1 
  elif str(lstin[i]) == "f" or str(lstin[i]) == "F":
    lstint[5] += 1
  elif str(lstin[i]) == "g" or str(lstin[i]) == "G":
    lstint[6] += 1
  elif str(lstin[i]) == "h" or str(lstin[i]) == "H":
    lstint[7] += 1
  elif str(lstin[i]) == "i" or str(lstin[i]) == "I":
    lstint[8] += 1
  elif str(lstin[i]) == "j" or str(lstin[i]) == "J":
    lstint[9] += 1
  elif str(lstin[i]) == "k" or str(lstin[i]) == "K":
    lstint[10] += 1
  elif str(lstin[i]) == "l" or str(lstin[i]) == "L":
    lstint[11] += 1
  elif str(lstin[i]) == "m" or str(lstin[i]) == "M":
    lstint[12] += 1
  elif str(lstin[i]) == "n" or str(lstin[i]) == "N":
    lstint[13] += 1
  elif str(lstin[i]) == "o" or str(lstin[i]) == "O":
    lstint[14] += 1
  elif str(lstin[i]) == "p" or str(lstin[i]) == "P":
    lstint[15] += 1
  elif str(lstin[i]) == "q" or str(lstin[i]) == "Q":
    lstint[16] += 1
  elif str(lstin[i]) == "r" or str(lstin[i]) == "R":
    lstint[17] += 1
  elif str(lstin[i]) == "s" or str(lstin[i]) == "S":
    lstint[18] += 1
  elif str(lstin[i]) == "t" or str(lstin[i]) == "T":
    lstint[19] += 1
  elif str(lstin[i]) == "u" or str(lstin[i]) == "U":
    lstint[20] += 1
  elif str(lstin[i]) == "v" or str(lstin[i]) == "V":
    lstint[21] += 1
  elif str(lstin[i]) == "w" or str(lstin[i]) == "W":
    lstint[22] += 1
  elif str(lstin[i]) == "x" or str(lstin[i]) == "X":
    lstint[23] += 1
  elif str(lstin[i]) == "y" or str(lstin[i]) == "Y":
    lstint[24] += 1
  elif str(lstin[i]) == "z" or str(lstin[i]) == "Z":
    lstint[25] += 1
for j in range(26):
  print(str(lstlet[j]) + " : " + str(lstint[j]))

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:
from collections import defaultdict

abc = ["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"]
d = defaultdict(int)

while True:
    try:
        s = input()
    except:
        break
    s = s.lower()
    s = list(s)
    
    for i in range(len(s)):
        if s[i] in abc:
            d[s[i]] += 1
    
for i in abc:
    print(i + " : " + str(d[i]))

Submission status: Accepted

Solution code:

import sys

f = sys.stdin
res = [0]*26

for l in f:
    line = l.lower()
    for i in range(26):
        res[i]+=line.count(chr(ord('a')+i))

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

Submission status: Accepted

Solution code:
alphabet='abcdefghijklmnopqrstuvwxyz'
dic={ch:0 for ch in alphabet}
while True:
    try:
        inp=input()
        if inp=="":break
        inp=inp.lower()
        for ch in inp:
            if ch in alphabet:
                dic[ch]+=1
    except EOFError:
        break

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

Submission status: Accepted

Solution code:
dict = {}
init = 'abcdefghijklmnopqrstuvwxyz'
for s in init:
    dict[s] = 0

list_sentence = []
while True:
    try:
        list_sentence.append(input())
    except:
        break;

for sentence in list_sentence:
    for s in sentence:
        if s.lower() in dict:
            dict[s.lower()] += 1

for k, v in dict.items():
    print(k, ':', v)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def main():
    dic = {}
    for i in range(ord("a"), ord("z")+1):
        dic[chr(i)] = 0
    for line in sys.stdin.readlines():
        for c in line.strip():
            c = c.lower()
            if c in dic:
                dic[c] += 1
    
    for c, count in sorted(dic.items(), key=lambda x: x[0]):
        print(c, ":", count)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

str = ""
for e in sys.stdin:
    str += e

alphabets = "abcdefghijklmnopqrstuvwxyz"

for c in list(alphabets):
    print("{} : {}".format(c, list(str.lower()).count(c)))

Submission status: Accepted

Solution code:
# 2020-03-19
a=''
while True:
    try:
        a += input().lower()
    except :
        break

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

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

def get_input():
  while True:
    try:
      line = input()
      if line == '':
        break
      else:
        yield line
    except EOFError:
      break

ans = []
sentence_list = list(get_input())
sentence = "".join(sentence_list).lower()

alphabet = list(string.ascii_lowercase)
for i in alphabet:
  ans.append(sentence.count(i))
for j, k in zip(alphabet, ans):
  print("{} : {}".format(j, k))

Submission status: Accepted

Solution code:
cnt_al = {"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}

word_list = list()
while True:
    try:
        words = input().lower()
        word_list.append(words)
    except:
        break

for words in word_list:
    for word in words:
        if word in cnt_al:
            cnt_al[word] += 1

for al,cnt in cnt_al.items():
    print(al,':',cnt)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read
inp = sys.stdin.buffer.readline
def inpS(): return inp().rstrip().decode()
readlines = sys.stdin.buffer.readlines
MOD = 10**9+7

S = sys.stdin.read()
S = S.lower()
dic_alpha = {s: 0 for s in "abcdefghijklmnopqrstuvwxyz"}

for s in S:
    if s in dic_alpha:
        dic_alpha[s] += 1
[print(k, ":", v) for k, v in dic_alpha.items()]

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:
st=[]

while True:
  try:
    n=input()
    if n=="":
      break
    st += n.lower()
  except:
    break
   
char = "abcdefghijklmnopqrstuvwxyz"
for i in range(len(char)):
  print(char[i],":",st.count(char[i]))

Submission status: Accepted

Solution code:
alphabet = ["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"]
a = [0 for i in range(26)]
s = ""
while True:
    try:
        s += input().lower()
    except EOFError:
        break

for i in range(len(s)):
    if s[i] in alphabet:
        a[alphabet.index(s[i])] += 1

for i in range(26):
    print(alphabet[i], ":", a[i])

Submission status: Accepted

Solution code:
dic={}
alp_lst=list('abcdefghijklmnopqrstuvwxyz')

for alp in alp_lst:
    dic[alp]=0
try:
    while True:
        sen=input()
        if sen=='':
            break
        sen=sen.lower()
        for i in sen:
            if i in alp_lst:
                dic[i]+=1
except EOFError:
    pass
for i in alp_lst:
    print(i+' : '+str(dic[i]))

Submission status: Accepted

Solution code:
import sys
s = []
for e in sys.stdin:
    if e != "\n":
        s += list(e.lower().replace(" ", ""))
    else:
        break
alfa = [chr(i) for i in range(97, 97+26)]
d = {}
for i in alfa:
    if i in s:
        d[i] = s.count(i)
    else:
        d[i] = 0
for k,v in d.items():
    print("{} : {}".format(k, v))

Submission status: Accepted

Solution code:
import string
import sys

input_str = sys.stdin.read()

for i in range(26):
    char = string.ascii_lowercase[i]
    CHAR = string.ascii_uppercase[i]
    cnt = input_str.count(char) + input_str.count(CHAR)
    print("{0} : {1}".format(char, cnt))

Submission status: Accepted

Solution code:
b = []
while True:
    try:
        s = input()
        b += list(s.lower())
    except:
        break

a = list("abcdefghijklmnopqrstuvwxyz")
for i in a:
    print("{} : {}".format(i, b.count(i)))

Submission status: Accepted

Solution code:

al="abcdefghijklmnopqrstuvwxyz"
count=[0]*26
while True:
    try:
        s=input()
    except:
        break
    for i in range(len(s)):
        for j in range(len(al)):
            if s[i]==al[j] or s[i]==al[j].upper():
                count[j]+=1

for i in range(len(al)):
    print("{0} : {1}".format(al[i],count[i]))

Submission status: Accepted

Solution code:
import sys
import _collections

def sa(Type= int):
  return [Type(x) for x in input().split()]

def solve():
  ff = _collections.defaultdict(int)

  mn = ord('a')
  mx = ord('z')

  s = sys.stdin.read()
  for ch in s:
    ch = ch.lower()
    chc = ord(ch)

    if mn <= chc <= mx:
      ff[ch]+= 1

  for chc in range(mn, mx+1):
    ch = chr(chc)
    print('{} : {}'.format(ch, ff[ch]))

if __name__ == '__main__':
  # sys.stdin = open('input.txt', 'r')

  solve()

Submission status: Accepted

Solution code:
alf = [0]*26

cnt = 0
s = []
while True:
    try:
        s.append(input().lower())
    except EOFError:
        break
    cnt += 1

for i in range(cnt):
    for st in s[i]:
        if ord('a') <= ord(st) and ord(st) <= ord('z'):
            alf[ord(st)-ord('a')] += 1
        

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

Submission status: Accepted

Solution code:
count = [0]*26
while True:
         try:
                  sample = (input())
         except:
                  break
         for i in range(len(sample)):
                  case = ord(sample[i])
                  if 65 <= case <= 90:
                           count[case-65] += 1
                  elif 97 <= case <= 122:
                           count[case-97] += 1
for i in range(26):
         print(chr(i+97)+" : "+str(count[i]))

Submission status: Accepted

Solution code:
import sys
s = sys.stdin.read()
# s = input()
alpha = "abcdefghijklmnopqrstuvwxyz"
cnt = [0] * len(alpha)
for i in s:
    for j in range(len(alpha)):
        if str.lower(i) == alpha[j]:
            cnt[j] += 1
for i in range(len(alpha)):
    print(alpha[i], ":", cnt[i])

Submission status: Accepted

Solution code:
import re


def main(text):
    hash = {}
    keys = 'abcdefghijklmnopqrstuvwxyz'
    for k in keys:
        hash[k] = 0
    for char in re.findall('[a-zA-Z]', text):
        hash[char.lower()] += 1
    return list(map(lambda k: '{} : {}'.format(k, hash[k]), keys))


if __name__ == "__main__":
    text = ''
    while True:
        try:
            input_str = str(input())
        except EOFError:
            break
        text += input_str
    results = main(text)
    print('\n'.join(results))

Submission status: Accepted

Solution code:
from string import ascii_lowercase as alfa

count = {}

for i in range(len(alfa)):
    count[alfa[i]] = 0
while True:
    try:
        S = list(input())

        for i in range(len(S)):
            if S[i].isupper():
                S[i] = S[i].lower()

        for i in range(len(alfa)):
            for k in range(len(S)):
                if alfa[i] == S[k]:
                    count[alfa[i]] += 1
    
    except EOFError:
        break       
        
    
for key, value in count.items():
    print('{} : {}'.format(key, str(value)))

Submission status: Accepted

Solution code:
import sys

lines = sys.stdin.read(1200)

list = [0] * 26

for i in lines:
    if i.isalpha():
        list[ord(i.lower()) - ord('a')] += 1
for i in range(26):
    print(chr(ord('a') + i), ':', list[i])

Submission status: Accepted

Solution code:
import string
abcxyz = string.ascii_lowercase
abccount = [0]*26
while 1:
    try:
        S = input()
    except:
        for i in range(26):
            print('{0} : {1}'.format(abcxyz[i], abccount[i]))
        break
    for x in S:
        if x.lower() in abcxyz:
            abccount[abcxyz.index(x.lower())] += 1

Submission status: Accepted

Solution code:
import sys
import itertools
import math

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

alphabet = [chr(ord('a') + i) for i in range(26)]
S = read().decode('utf8').rstrip().lower()
for i in alphabet:
    print(f'{i} : {S.count(i)}')

Submission status: Accepted

Solution code:
import sys
cnts = []
alpha = "abcdefghijklmnopqrstuvwxyz"
for line in sys.stdin:
  for c in list(line.lower()):
    cnts.append(c)
for a in alpha:
      print("{} : {}".format(a,cnts.count(a)))

Submission status: Accepted

Solution code:
char_list = "abcdefghijklmnopqrstuvwxyz"
char_count = {}
for c in char_list:
    char_count[c] = 0
s = ""
while True:
    try:
        s += input().lower()
    except EOFError:
        break
for c in s:
    if c in char_count:
        char_count[c] += 1
for char, count in char_count.items():
    print("{} : {:d}".format(char, count))

Submission status: Accepted

Solution code:
import sys
import string

counter = {c: 0 for c in string.ascii_letters}
input_str = sys.stdin.read()

for char in input_str:
    char = char.lower()
    if char in string.ascii_letters:
        counter[char] += 1

for c in string.ascii_lowercase:
    v = 0 if c not in counter else counter[c]
    print('{} : {}'.format(c, v))

Submission status: Accepted

Solution code:
import sys

sm_alpha = [chr(ord('a') + i) for i in range(26)]
lg_alpha = [chr(ord('A') + i) for i in range(26)]

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

for e in sys.stdin :
    for i in range(26) :
        num_alpha[i] += e.count(sm_alpha[i])
        num_alpha[i] += e.count(lg_alpha[i])

for i in range(26) :
    print(sm_alpha[i] + " : " + str(num_alpha[i]))

Submission status: Accepted

Solution code:
import sys

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

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

for i in s:
    index = 0
    for j in alf:
        if j == i:
            table[index] += 1
            break
        index += 1

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

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:
import sys
input = sys.stdin.readlines
ans = {chr(i):0 for i in range(ord("a"), ord("z")+1)}

for l in input():
    for _s in l:
        _s = _s.lower()
        if ord("a") <= ord(_s) <= ord("z"):
            ans[_s] += 1

for i in range(ord("a"), ord("z")+1):
    k = chr(i)
    print(k + " : " + str(ans[k]))

Submission status: Accepted

Solution code:
from collections import Counter
inputs = ''
while True:
    try:
        inputs += input()
    except:
        break


ss = []
s = [x.strip('.') for x in inputs.split()]
for si in s:
    ss += list(si.lower())

cnt = Counter(ss)

for i in range(97, 123):
    print('{} : {}'.format(chr(i), cnt[chr(i)]))

Submission status: Accepted

Solution code:
import sys
x = sys.stdin.readlines()
x = "".join(x)
for a in [chr(ord('a') + i) for i in range(26)]:
    print("{0} : {1}".format(a,x.lower().count(a)))

Submission status: Accepted

Solution code:
dic_alp= {alp:0 for alp in 'abcdefghijklmnopqrstuvwxyz'}
while True:
    try:
        txt = input()
        
        for s in txt:
            s = s.lower()
            if s in dic_alp.keys():
                dic_alp[s] += 1
    except:
        break

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

Submission status: Accepted

Solution code:
import sys

dic = {}

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

Submission status: Accepted

Solution code:

c = {}

for char in ['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[char] = 0


while True:
    try:
        s = input()
        if s == '':
            break
        
        for i in range(len(s)):
            char = s[i : i + 1]
            
            if char.isalpha():
                c[char.lower()] += 1
        
    except EOFError:
        break

for k, v in c.items():
    print(f'{k} : {v}')

Submission status: Accepted

Solution code:
alpha="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
count=[0 for i in range(26)]
test=""
while True:
    try:
        string=input()
        test+=string
    except:
        break

for i in range(len(test)):
    for j in range(26):
        if test[i]==alpha[j] or test[i]==alpha[j+26]:
            count[j]+=1
            break

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

Submission status: Accepted

Solution code:
import sys

S = sys.stdin.read()

abc = [0 for i in range(26)]
for i in range(len(S)):
    ords = ord(S[i])
    if 65 <= ords < 65+26:
        abc[ords-65] += 1
    elif 97 <= ords < 97+26:
        abc[ords-97] += 1

for i in range(26):
    word = chr(i+97)
    count = abc[i]
    print('{} : {}'.format(word,count))

Submission status: Accepted

Solution code:
import sys
a = []
for line in sys.stdin:
    a += line

chr = 'abcdefghijklmnopqrstuvwxyz'
for c in chr:
    cnt1 = a.count(c)
    cnt2 = a.count(c.upper())
    print(c + ' : ' + str(cnt1+cnt2))

Submission status: Accepted

Solution code:
answerAlpha = []
answerNum = []

# 全アルファベットに0を初期セット
for i in range(97, 97 + 26):
    answerAlpha.append(chr(i))
    answerNum.append(0)

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

for i in range(len(inp)):
    if inp[i] in answerAlpha:
        answerNum[answerAlpha.index(inp[i])] += 1    

[print("{} : {}".format(*answerAlpha[i], answerNum[i])) for i in range(len(answerNum))]

Submission status: Accepted

Solution code:
import sys
counter = [0] * 26
s = ""
for item in sys.stdin:
    s += item

for item in s:
    tmp = ord(item) - ord('a')
    if 0 <= tmp and tmp <= 25:
        counter[tmp] += 1

    tmp = ord(item) - ord('A')
    if 0 <= tmp and tmp <= 25:
        counter[tmp] += 1

for i in range(len(counter)):
    print(f"{chr(i+ord('a'))} : {counter[i]}")

Submission status: Accepted

Solution code:
str=""
while True:
    try:
        s=input()
        str+=s
        if s=='':
            break
    except EOFError:
        break
str=str.lower()
for s in "abcdefghijklmnopqrstuvwxyz":
    print(s,":",str.count(s))

Submission status: Accepted

Solution code:
import sys

chklist = ['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']

word = ''
for i in sys.stdin:
    word += i

for n in chklist:
    cnt = 0
    for w in word:
        if n.upper() == w.upper():
            cnt += 1
    print(str.format('{} : {}', n, cnt))

Submission status: Accepted

Solution code:
alphabet = 'abcdefghijklmnopqrstuvwxyz'
str_x = open(0).read().lower()
for str_a in alphabet:
    print(str_a,':',str_x.count(str_a),sep=' ')

Submission status: Accepted

Solution code:
cnt = [0]*26
while True:
    try:
        s = input().lower()
    
        for i in range(len(s)):
            m = ord(s[i]) - ord('a')
            if m >= 0 and m <= 25:
                cnt[m] += 1

    except:
        break
                
for i in range(26):
    print('{0} : {1}'.format(chr(i+ord('a')),cnt[i]))

Submission status: Accepted

Solution code:
import fileinput
T = [0 for i in range(26)]
for line in fileinput.input():
 S = list(map(int, line.encode() ))
 A = ord('A')
 Z = ord('Z')
 a = ord('a')
 z = ord('z')
 for c in S:
  if A<=c<=Z:
   T[c-A] = T[c-A]+1
  elif a<=c<=z:
   T[c-a] = T[c-a]+1
for c in range(a,z+1):
 print(chr(c),":",T[c-a])

Submission status: Accepted

Solution code:
#インプットdataの格納(小文字に変換)
input_data = ""
while True:
    try:
        input_data_temp = input().lower()
    except:
        break
    input_data += input_data_temp

#結果の表示
for letter in "abcdefghijklmnopqrstuvwxyz":
    print(f"{letter} : {input_data.count(letter)}")

Submission status: Accepted

Solution code:
queue=[]
ans=''
al=['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']
cou=-1

while 1:
    try:
        string=input().lower()
        queue.append(string)
    except EOFError:
        break
    
for i in queue:
    ans+=i

for i in al:
    cou+=1
    print(al[cou]+' '+ ':'+' '+str(ans.count(i)))

Submission status: Accepted

Solution code:
list = [0]*26
while 1:
    try:
        a = input()
        for i in a: 
            for j in range(26):
                if ord(i) == j+65 or ord(i) == j+97:list[j] += 1
    except:break
for k in range(26):
    print(chr(k+97)+ " : "+str(list[k]))

Submission status: Accepted

Solution code:
S = open(0).read().lower()
a = [0 for i in range(26)]
for c in S:
    if ord(c) >= 97 and ord(c) <= 97+25:
        a[ord(c)-97] += 1
for i in range(26):
    print('{} : {}'.format(chr(i+97), a[i]))

Submission status: Accepted

Solution code:
import string

asclst = string.ascii_lowercase
count = [0 for i in range(len(asclst))]
string = ""
while True:
    try:
        string += input().lower()
    except EOFError:
        break


for char in string:
    for i,c in enumerate(asclst):
        if char == c:
            count[i] += 1

for i,ch in enumerate(asclst):
    print(f"{ch} : {count[i]}")

Submission status: Accepted

Solution code:
import sys
import collections
d = collections.Counter([c.lower() for c in sys.stdin.read()])
for i in range(26):
	b = bytearray('a'.encode('ascii'))
	b[0] += i
	c = b.decode('ascii')
	print("{} : {}".format(c,d[c]))

Submission status: Accepted

Solution code:
alpha = [0] * 26
S = []
while True:
    try:
        S += list(input())
    except EOFError:
        break
for s in S:
    if not s.isalpha():
        continue
    c = ord(s.lower())-97
    alpha[c] += 1
for i,a in enumerate(alpha):
    s = chr(i+97)
    print(s + ' : ' + str(a))

Submission status: Accepted

Solution code:
import string

result = {}
for char in string.ascii_lowercase:
    result[char] = 0

while True:
    try:
        words = input().lower()
    except:
        break
    
    for char in words:
        try:
          result[char] += 1
        except:
          pass

for char in string.ascii_lowercase:
    print(f"{char} : {result[char]}")

Submission status: Accepted

Solution code:
dec = {}
dec["a"] = 0
dec["b"] = 0
dec["c"] = 0
dec["d"] = 0
dec["e"] = 0
dec["f"] = 0
dec["g"] = 0
dec["h"] = 0
dec["i"] = 0
dec["j"] = 0
dec["k"] = 0
dec["l"] = 0
dec["m"] = 0
dec["n"] = 0
dec["o"] = 0
dec["p"] = 0
dec["q"] = 0
dec["r"] = 0
dec["s"] = 0
dec["t"] = 0
dec["u"] = 0
dec["v"] = 0
dec["w"] = 0
dec["x"] = 0
dec["y"] = 0
dec["z"] = 0
while True:
    try:
        for s in list(input()):
            if s.lower() in dec:
                dec[s.lower()] += 1
    except:
        break
for n in dec:
    print(f"{n} : {dec[n]}")

Submission status: Accepted

Solution code:
dec = {}
dec["a"] = 0
dec["b"] = 0
dec["c"] = 0
dec["d"] = 0
dec["e"] = 0
dec["f"] = 0
dec["g"] = 0
dec["h"] = 0
dec["i"] = 0
dec["j"] = 0
dec["k"] = 0
dec["l"] = 0
dec["m"] = 0
dec["n"] = 0
dec["o"] = 0
dec["p"] = 0
dec["q"] = 0
dec["r"] = 0
dec["s"] = 0
dec["t"] = 0
dec["u"] = 0
dec["v"] = 0
dec["w"] = 0
dec["x"] = 0
dec["y"] = 0
dec["z"] = 0
while True:
    try:
        for s in list(input()):
            if s.lower() in dec:
                dec[s.lower()] += 1
    except:
        break
for n in dec:
    print(f"{n} : {dec[n]}")

Submission status: Accepted

Solution code:
import re
import sys

# アルファベットをリストに入れる
alphbt = list("abcdefghijklmnopqrstuvwxyz")

# インプットデータを受け取る
inp = ""
for line in sys.stdin.readlines():
    inp += line

# 処理実行
for alp in alphbt:
    count = len(re.findall(alp, inp, flags=re.IGNORECASE))
    print(f"{alp} : {count}")

Submission status: Accepted

Solution code:
b=[chr(i) for i in range(97,97+26)]
c=[chr(i) for i in range(65,65+26)]
d=[0 for i in range(26)]
flg=True
while flg==True:
    try:
        a=raw_input()
        for i in a:
            for j in range(len(b)):
                if i==b[j]:
                    d[j]+=1
            for k in range(len(c)):
                if i==c[k]:
                    d[k]+=1
    except:
            flg=False
for i in range(26):
    print (b[i]+" : "+str(d[i]))

Submission status: Accepted

Solution code:
import sys
import string

lst = list(string.ascii_lowercase)
dic = dict([[c, 0] for c in lst])

for c in list(sys.stdin.read().lower()):
  if c in dic: dic[c] = dic[c] + 1

for c in lst:
  print(f"{c} : {dic[c]}")

Submission status: Accepted

Solution code:
tbl = [0] * 26
while True:
    try:
        s = input().lower()
        for i in s:
            if 96 < ord(i) < 124:
                tbl[ord(i) - 97] += 1
    except:
        break

for i in range(26):
    print(f"{chr(i + 97)} : {tbl[i]}")

Submission status: Accepted

Solution code:
from collections import defaultdict
import re
import sys

def count_char(inp):

    dic = { chr(c) : 0 for c in range(97, 123)}

    inp = re.sub("[,.]", "", inp)
    inp = inp.replace("\n", "")
    inp = inp.lower()

    for c in inp:
        if c in dic.keys():
            dic[c] += 1

    for n, (k, v) in enumerate(dic.items()):
        print(str(k) + " : " + str(v), end = "")

        if n != len(dic) - 1:
            print("\n", end = "")
        else:
            print("\n", end = "")

if __name__ == "__main__":

    # str = ""
    #
    # while(True):
    #     param = input().split("\n", "")
    #
    #     if param != "":
    #         str += param
    #     else:
    #         break
    #
    #
    # str = "".join(s)

    stri = ""

    for e in sys.stdin:
        stri += e
    
    count_char(stri)

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:
import re
import string
import sys


s = sys.stdin.read()
s = re.sub(r"[^a-z]", "", s.lower())
s = list(s)

for a in string.ascii_lowercase:
    print(f"{a} : {s.count(a)}")

Submission status: Accepted

Solution code:
alp = [0 for i in range(26)]
while(True):
    try:
        s = input()
        for i in range(len(s)):
            if s[i].isalpha():
                alp[ord(s[i].lower())-97] = alp[ord(s[i].lower())-97] + 1
    except EOFError:
        break
for i in range(97,97+26):
    print(chr(i),":",alp[i-97])

Submission status: Accepted

Solution code:
import sys
string = []
words = [0] * 26
for line in sys.stdin.readlines():
    string.append(list(line))
for i in range(len(string)):
    for j in range(len(string[i])):
        code = int(ord(string[i][j].lower())) - 97
        if code >= 0 and code < 26:
            words[code] += 1
for k in range(26):
    print("{} : {}".format(chr(k+97), words[k]))

Submission status: Accepted

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

char=ord("a")
while(char<=ord("z")):
    print(chr(char)+" : "+str(sentence.count(chr(char))))
    char+=1

Submission status: Accepted

Solution code:
alpha = 'abcdefghijklmnopqrstuvwxyz'

letters = ''

while True:
    try:
        newLetters = str(input())
        letters += newLetters

    except:
        break

    
for a in alpha:
    x = 0
    for l in letters:
        if l.lower() == a:
            x += 1
    print(a + ' : ' + str(x))

Submission status: Accepted

Solution code:
import sys
r = [0]*26
S = ""
for line in sys.stdin.readlines():
    S += line
for i in S:
    if ord("a") <= ord(i) <= ord("z"):
        r[ord(i)-ord("a")] += 1
    elif ord("A") <= ord(i) <= ord("Z"):
        r[ord(i)-ord("A")] += 1
for i in range(26):
    print(chr(i+97) + " : " + str(r[i]))

Submission status: Accepted

Solution code:
import sys
s = sys.stdin.read().lower()
for i in range (ord("a"), ord("z")+1):print(chr(i), ":", s.count(chr(i)))

Submission status: Accepted

Solution code:
import sys
string =[]
for j in sys.stdin:
    string.append(j)
string2 = []
for k in string:
    string2.append(k.strip("\n"))


string3 = ''.join(string2) 

alphabet = list("abcdefghijklmnopqrstuvwxyz")
string3 = string3.lower()   
for i in alphabet:
    print(f'{i} : {string3.count(i)}')

Submission status: Accepted

Solution code:
import sys
s=''
for line in sys.stdin:
    s+=line
s=s.lower()
for c in range(ord('a'),ord('z')+1):
    print(chr(c),':',s.count(chr(c)))

Submission status: Accepted

Solution code:
import sys
letters=['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']
str = sys.stdin.read()

for i in letters:
    print('%s : %d' %(i, str.casefold().count(i)))

Submission status: Accepted

Solution code:
import sys
s = sys.stdin.read().lower()
num = [0]*26

for i in range(len(s)):
    if 0<=ord(s[i])-97<26:
        num[ord(s[i])-97] += 1

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

Submission status: Accepted

Solution code:
S = open(0).read().strip().lower()
A = [chr(c) for c in range(ord('a'), ord('z')+1)]
B = dict(zip(iter(A), map(lambda a: S.count(a), iter(A))))
for k, v in B.items():
    print(f'{k} : {v}')