qyliang/CodeNanoFix huggingface dataset:
Buggy code:
a=[0]*26
w='abcdefghijklmnopqrstuvwxyz'
try:
    while True:
        s=list(input().upper())
        for i in s:
            if i=='A':
                a[0]+=1
            elif i=='B':
                a[1]+=1
            elif i=='C':
                a[2]+=1
            elif i=='D':
                a[3]+=1
            elif i=='E':
                a[4]+=1
            elif i=='F':
                a[5]+=1
            elif i=='G':
                a[6]+=1
    elif i=='H':
        a[7]+=1
    elif i=='I':
        a[8]+=1
    elif i=='J':
        a[9]+=1
    elif i=='K':
        a[10]+=1
    elif i=='L':
        a[11]+=1
    elif i=='M':
        a[12]+=1
    elif i=='N':
        a[13]+=1
    elif i=='O':
        a[14]+=1
    elif i=='P':
        a[15]+=1
    elif i=='Q':
        a[16]+=1
    elif i=='R':
        a[17]+=1
    elif i=='S':
        a[18]+=1
    elif i=='T':
        a[19]+=1
    elif i=='U':
        a[20]+=1
    elif i=='V':
        a[21]+=1
    elif i=='W':
        a[22]+=1
            elif i=='X':
                a[23]+=1
            elif i=='Y':
                a[24]+=1
            elif i=='Z':
                a[25]+=1 

except EOFError:
    pass

for i in range(26):
    print(w[i:i+1], ':', str(a[i]))

Fixed code:
a=[0]*26
w='abcdefghijklmnopqrstuvwxyz'
try:
    while True:
        s=list(input().upper())
        for i in s:
            if i=='A':
                a[0]+=1
            elif i=='B':
                a[1]+=1
            elif i=='C':
                a[2]+=1
            elif i=='D':
                a[3]+=1
            elif i=='E':
                a[4]+=1
            elif i=='F':
                a[5]+=1
            elif i=='G':
                a[6]+=1
            elif i=='H':
                a[7]+=1
            elif i=='I':
                a[8]+=1
            elif i=='J':
                a[9]+=1
            elif i=='K':
                a[10]+=1
            elif i=='L':
                a[11]+=1
            elif i=='M':
                a[12]+=1
            elif i=='N':
                a[13]+=1
            elif i=='O':
                a[14]+=1
            elif i=='P':
                a[15]+=1
            elif i=='Q':
                a[16]+=1
            elif i=='R':
                a[17]+=1
            elif i=='S':
                a[18]+=1
            elif i=='T':
                a[19]+=1
            elif i=='U':
                a[20]+=1
            elif i=='V':
                a[21]+=1
            elif i=='W':
                a[22]+=1
            elif i=='X':
                a[23]+=1
            elif i=='Y':
                a[24]+=1
            elif i=='Z':
                a[25]+=1 

except EOFError:
    pass

for i in range(26):
    print(w[i:i+1], ':', str(a[i]))
Buggy 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']
cnt = 26 * [0]
Input = ""
loop = True

while loop:
    I = input()
    if not I:
        loop = False
    Input += I

for i1 in range(len(alphabet)):
    for i2 in range(len(Input)):
        if 'A' <= Input[i2] <= 'Z':
            w = Input[i2].lower()
        else:
            w = Input[i2]
        if alphabet[i1] == w:
            cnt[i1] += 1
    print(alphabet[i1] + " : " + str(cnt[i1]))

Fixed code:
import sys

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']
cnt = 26 * [0]
Input = ""
loop = True

#while loop:
#    I = input()
#    if not I:
#        loop = False
#    Input += I

for I in sys.stdin:
    Input += I

for i1 in range(len(alphabet)):
    for i2 in range(len(Input)):
        if 'A' <= Input[i2] <= 'Z':
            w = Input[i2].lower()
        else:
            w = Input[i2]
        if alphabet[i1] == w:
            cnt[i1] += 1
    print(alphabet[i1] + " : " + str(cnt[i1]))
Buggy 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']
cnt = 26 * [0]
Input = ""
loop = True

while loop:
    I = input()
    if I == '':
        loop = False
    Input += I

for i1 in range(len(alphabet)):
    for i2 in range(len(Input)):
        if 'A' <= Input[i2] <= 'Z':
            w = Input[i2].lower()
        else:
            w = Input[i2]
        if alphabet[i1] == w:
            cnt[i1] += 1
    print(alphabet[i1] + " : " + str(cnt[i1]))

Fixed code:
import sys

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']
cnt = 26 * [0]
Input = ""
loop = True

for I in sys.stdin:
    Input += I

for i1 in range(len(alphabet)):
    for i2 in range(len(Input)):
        if 'A' <= Input[i2] <= 'Z':
            w = Input[i2].lower()
        else:
            w = Input[i2]
        if alphabet[i1] == w:
            cnt[i1] += 1
    print(alphabet[i1] + " : " + str(cnt[i1]))
Buggy code:
#! python3
# counting_characters.py

import sys

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

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))


Fixed 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))
Buggy code:
list_str2 = [0 for i in range(26)]

while(1):
	list_str1 = list(input())
	print(list_str1)
	if list_str1 == []:
		break
	for i in range(len(list_str1)):
		if 97 <= ord(list_str1[i].lower()) <= 122:
			list_str2[ord(list_str1[i].lower())-97] += 1

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

Fixed code:
list_str2 = [0 for i in range(26)]

while(1):
	try:
		list_str1 = list(input())
		#print(list_str1)
	except:
		break
	for i in range(len(list_str1)):
		if 97 <= ord(list_str1[i].lower()) <= 122:
			list_str2[ord(list_str1[i].lower())-97] += 1

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


Fixed code:
a = "abcdefghijklmnopqrstuvwxyz"
b = ''
while 1:
    try:
        b += input().lower()
    except:
        break
for i in range(26):
    print(a[i],':',b.count(a[i]))
Buggy code:
text = ''
while True:
    s = input().lower()
    if s == '':
        break
    text += s
for i in 'abcdefghijklmnopqrstuvwxyz':
    print(i+' : '+str(text.count(i)))
    #print("{0} : {1}".format(i, text.count(i)))

Fixed code:
text = ''
while True:
    try:
        s = input().lower()
    except EOFError:
        break
    if s == '':
        break
    text += s
for i in 'abcdefghijklmnopqrstuvwxyz':
    print(i+' : '+str(text.count(i)))
    #print("{0} : {1}".format(i, text.count(i)))
Buggy code:
alp_count = [0]*26



string = open(0).read()
string = string.lower()


alp = [chr(ord("a")+i) for i in range(26)]

c = 0

for j in range(26):
    c = string.count(alp[j])
    alp_count[j] += c
    print("%s : %d\n"%(alp[j],alp_count[j]))


Fixed code:
alp_count = [0]*26



string = open(0).read()
string = string.lower()


alp = [chr(ord("a")+i) for i in range(26)]

c = 0

for j in range(26):
    c = string.count(alp[j])
    alp_count[j] += c
    print("%s : %d"%(alp[j],alp_count[j]))
Buggy code:
import string
count = {x: 0 for x in string.ascii_lowercase}
lines = ""

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

for c in lines:
    if 'a' <= c <= 'z':
        count[c] += 1

for key in string.ascii_lowercase:
    print("{0} : {1}".format(key, count(key)))

Fixed code:
import string
count = {x: 0 for x in string.ascii_lowercase}
lines = ""

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

for c in lines:
    if 'a' <= c <= 'z':
        count[c] += 1

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

Fixed 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)))
Buggy code:
table = [0] * 26
string = []
while True:
  try:
    string += list(input())
  except EOFError:
    break

for s in string:
  n = ord(s.lower()) - 97
  if n >= 0 and n <= 25:
    table[n] += 1

for idx, s in enumerate(table):
  print(chr(idx + 97) + " : " + str(s)


Fixed code:
table = [0] * 26
string = []
while True:
  try:
    string += list(input())
  except EOFError:
    break

for s in string:
  n = ord(s.lower()) - 97
  if n >= 0 and n <= 25:
    table[n] += 1

for idx, s in enumerate(table):
  print(chr(idx + 97) + " : " + str(s))
Buggy code:
text = input()
text_new = text.lower()
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"]
for i in alphabet:
    tmp = 0
    for j in text_new:
        if j == i:
            tmp += 1
    print(i + ":" + str(tmp))



Fixed code:
text = ""
while 1:
    try:
        x = input()
        text += x
    except EOFError:
        break
text_new = text.lower()
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"]
for i in alphabet:
    tmp = 0
    for j in text_new:
        if j == i:
            tmp += 1
    print(i + " : " + str(tmp))
Buggy code:
s = ""
while True:
    try:
        s += input()
    except:
        break
    
l = list(s)
alphabet = list("abcdefghijklmnopqrstuvwxyz")
c = [l.count(alphabet[i]) for i in range(26)]
for i in range(26):
    print("{} : {}".format(alphabet[i],c[i]))

Fixed code:
s = ""
while True:
    try:
        s += input()
    except:
        break
    
l = list(s.lower())
alphabet = list("abcdefghijklmnopqrstuvwxyz")
c = [l.count(alphabet[i]) for i in range(26)]
for i in range(26):
    print("{} : {}".format(alphabet[i],c[i]))
Buggy code:
import sys

array = ""
for line in sys.stdin:
    array += line

char = ["" for _ in range(len(array))]
for i in range(len(array)):
    char[i] = array[i:i+1]

count = [0 for _ in range(26)]
for c in char:
    for i in range(26):
        if c == chr(i+ord("A")) or c == chr(i+ord("a")):
            count[i] += 1

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

Fixed code:
import sys

count = [0 for _ in range(26)]

for line in sys.stdin:
    array = line
    char = ["" for _ in range(len(array))]
    for i in range(len(array)):
        char[i] = array[i:i+1]
    for c in char:
        for i in range(26):
            if c == chr(i+ord("A")) or c == chr(i+ord("a")):
                count[i] += 1


for i in range(26):
    print("{0} : {1}".format(chr(i+ord("a")), count[i]))
Buggy code:
# Counting Characters
import sys

charList = list('abcdefghijklmnopqrstuvwxyz')
lines = sys.stdin.readlines()
combinedLine = ""
for line in lines:
    line = line.strip("\n")
    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))



Fixed 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))
Buggy code:
from collections import Counter
import re

chardict = {chr(i):0 for i in range(97, 97+26)}
str1 = raw_input()
str1 = re.sub('[^a-z]', '', str1.lower())
counter = Counter(str1)
for word in counter:
    chardict[word] = counter[word]
charlist = sorted(chardict.items())
for x in charlist:
    print(x[0] + ' : ' + str(x[1]))

Fixed code:
import sys
import re
from collections import Counter

chardict = {chr(i):0 for i in range(97, 97+26)}
str1 = sys.stdin.read()
str1 = re.sub('[^a-z]', '', str1.lower())
counter = Counter(str1)
for word in counter:
    chardict[word] = counter[word]
charlist = sorted(chardict.items())
for x in charlist:
    print(x[0] + ' : ' + str(x[1]))
Buggy code:
import sys
s = sys.stdin.read()
c = 97
while chr(c-1)!='z':
    print('{0} : {1}'.format(chr(c),s.count(chr(c))))
    c += 1



Fixed code:
import sys
s = sys.stdin.read()
s = s.lower()
c = 97
while chr(c-1)!='z':
    print('{0} : {1}'.format(chr(c),s.count(chr(c))))
    c += 1
Buggy code:
import string

count = {x: 0 for x in string.ascii_lowercase}
lines = ""

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

for c in lines:
    if 'a' <= c <= 'z':
        count[c] += 1

for key in string.ascii_lowercase:
    print("{0 : {1}".format(key, count[key]))

Fixed code:
import string
  
count = {x: 0 for x in string.ascii_lowercase}
lines = ""
  
while True:
    try:
        lines += input().lower()
    except EOFError:
        break
          
for c in lines:
    if 'a' <= c <= 'z':
        count[c] += 1
          
for key in string.ascii_lowercase:
    print("{0} : {1}".format(key, count[key]))
Buggy 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))))



Fixed 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))))
Buggy code:
import string

count = {x: 0 for x in string.ascii_lowercase}
lines = ""

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

for c in s:
    if 'a' <= c <= 'z':
            count[c] += 1

for key in string.ascii_lowercase:
    print("{0} : {1}".format(key, count[key]))

Fixed code:
import string

count = {x: 0 for x in string.ascii_lowercase}
lines = ""

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

for c in lines:
    if 'a' <= c <= 'z':
            count[c] += 1

for key in string.ascii_lowercase:
    print("{0} : {1}".format(key, count[key]))
Buggy code:
try:
	s = ''
	while True:
		s = s + input().lower()
except EOFError:
[print(chr(o)+' : '+str(s.count(chr(o)))) for o in range(ord('a'),ord('z')+1)]

Fixed code:
try:
	s = ''
	while True:
		s = s + input().lower()
except EOFError:
	[print(chr(o)+' : '+str(s.count(chr(o)))) for o in range(ord('a'),ord('z')+1)]
Buggy code:
import sys

#fin = open("test.txt", "r")
fin = sys.stdin

sentence = fin.readline()
sentence = sentence.lower()

num_alphabet_list = [0 for i in range(27)]

for c in sentence:
	if ord(c) < ord('a') or ord(c) > ord('z'):
		continue

	num_alphabet_list[ord(c) - ord('a')] += 1

for i in range(0, 27):
	print(chr(i + ord('a')), end="")
	print(" : ", end="")
	print(num_alphabet_list[i])

Fixed code:
import sys

#fin = open("test.txt", "r")
fin = sys.stdin

sentence = fin.read()
sentence = sentence.lower()

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

for c in sentence:
	if ord(c) < ord('a') or ord(c) > ord('z'):
		continue

	num_alphabet_list[ord(c) - ord('a')] += 1

for i in range(0, 26):
	print(chr(i + ord('a')), end="")
	print(" : ", end="")
	print(num_alphabet_list[i])
Buggy code:
a = {x:0 for x in range(ord('a'), ord('z') + 1)}

while True:
    try:
        text = input()
        for x in text:
            if ord('a') <= ord(x) <= ord('z'):
                a[ord(x.lower())] += 1
    except EOFError:
        break

for x in range(ord('a'), ord('z') + 1):
    print(chr(x), ':', a[x])

Fixed code:
a = {x:0 for x in range(ord('a'), ord('z') + 1)}

while True:
    try:
        text = input()
        for x in text:
            if ord('a') <= ord(x) <= ord('z') or ord('A') <= ord(x) <= ord('Z'):
                a[ord(x.lower())] += 1
    except EOFError:
        break

for x in range(ord('a'), ord('z') + 1):
    print(chr(x), ':', a[x])
Buggy code:
import string

count = {x: 0 for x in string.ascii_lowercase}
lines = ''

s = input().lower()

while 1:
    try:
        lines += input().lower()
    except EOFError:
        break

for c in lines:
    if 'a' <= c <= 'z':
        count[c] += 1

for key  in string.ascii_lowercase:
    print("{0} : {1}".format(key, count[key]))

Fixed code:
import string

count = {x: 0 for x in string.ascii_lowercase}
lines = ''

while 1:
    try:
        lines += input().lower()
    except EOFError:
        break

for c in lines:
    if 'a' <= c <= 'z':
        count[c] += 1

for key in string.ascii_lowercase:
    print("{0} : {1}".format(key, count[key]))
Buggy 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 'abcdefghijklmnopqrstuvexyz':
        print('{} : {}'.format(c, word[c]))


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

Fixed 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:])
Buggy code:
alphabet = 'abcdefghijklmnopqrstuvwxyz'
from collections import defaultdict
import sys

adict = defaultdict(int)

for l in sys.stdin:
    for c in l:
        adict[c] += 1
        
for k in alphabet:
    print('%s : %i' %(k, adict[k]))

Fixed code:
alphabet = 'abcdefghijklmnopqrstuvwxyz'
from collections import defaultdict
import sys

adict = defaultdict(int)

for l in sys.stdin:
    for c in l.lower():
        adict[c] += 1
        
for k in alphabet:
    print('%s : %i' %(k, adict[k]))
Buggy 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']

dic = {}
for c in alphabet:
	dic[c] = 0

while True:
	string = list(input().rstrip().lower())
	if string == []: break

	for c in string:
		if c in alphabet:
			dic[c] = dic[c] + 1

for key in dic:
	print('{} : {}'.format(key, dic[key]))


Fixed 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']

dic = {}
for c in alphabet:
	dic[c] = 0

while True:
	try:
		string = list(input().rstrip().lower())
	except EOFError:
		break

	for c in string:
		if c in alphabet:
			dic[c] = dic[c] + 1

for key in dic:
	print('{} : {}'.format(key, dic[key]))
Buggy code:
import sys

alp=[]
txt=[]
for i in range(97,97+26):
	alp.append(chr(i))

txt=sys.stdin.read()

for i in alp:
	num=0
	for j in txt:
		if i==j:
			num+=1
	print(i+' : '+str(num))



Fixed code:
import sys

alp=[]
for i in range(97,97+26):
	alp.append(chr(i))

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

for i in alp:
	num=0
	for j in s:
		if i==j:
			num+=1
	print(i+' : '+str(num))
Buggy code:
import sys

charas = 'abcdefghijklmnopqrstuvwxyz'

data = []
for line in sys.stdin:
    data.append(line)
for chara in chara:
    for row in data:
        cnt = row.count(chara)
        cnt += row.count(chara.upper())
    print('{} : {}'.format(chara, cnt))

Fixed code:
import sys

charas = 'abcdefghijklmnopqrstuvwxyz'

data = []
for line in sys.stdin:
    data.append(line)
for chara in charas:
    cnt = 0
    for row in data:
        cnt += row.count(chara)
        cnt += row.count(chara.upper())
    print('{} : {}'.format(chara, cnt))
Buggy code:
from collections import OrderedDict as od

 
dic = od()
for s in "abcdefghijklmnopqrstuvwxyz":
    dic[s] = 0

x = ""
while True:  
    try:  
        x += line
    except EOFError:
        break

for key,value in dic.items():
    value = x.count(key)
    print(key, ":", value)


Fixed 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)
Buggy 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='')


Fixed 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='')
Buggy code:
import collections
import string

def solve(s):
    counter = collections.Counter(s)
    lows = string.ascii_lowercase
    cnt = [counter[ch] for ch in lows]
    for (ch, n) in zip(lows, cnt):
        print('{0} : {1}'.format(ch, n))

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

Fixed code:
import collections
import string

def solve(s):
    s = s.lower()
    counter = collections.Counter(s)
    lows = string.ascii_lowercase
    cnt = [counter[ch] for ch in lows]
    for (ch, n) in zip(lows, cnt):
        print('{0} : {1}'.format(ch, n))

if __name__ == '__main__':
    s = ''
    while True:
        try:
            s += input()
        except:
            break
    solve(s)
Buggy code:
import sys
from collections import Counter
S = ""
for s in sys.stdin:
    s = s.strip()
    if not s:
        break
    S += s
for i in 'abcdefghijklmnopqrstuvwxyz':
    print(i, ":", S.count(i))



Fixed 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))
Buggy code:
import sys
from collections import Counter
m = Counter(sys.stdin.read.lower())
for i in 'abcdefghijklmnopqrstuvwxyz':
    print(i, ":", m[i])


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

for data in dataset:
 for s in range(ord('a'), ord('z') + 1):
  print("{0}:{1}".format(chr(s), data.lower().count(chr(s))))

Fixed code:
import sys 
dataset = sys.stdin.readlines()

for s in range(ord('a'), ord('z') + 1):
 count = 0
 for data in dataset:
  count += data.lower().count(chr(s))
 print("{0} : {1}".format(chr(s), count))