题解 | #字母统计#
字母统计
https://www.nowcoder.com/practice/de7bf0945c1c4bd1aa9d49573b831f3c
a=list('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'.split()) dict1={} while True: for i in range(len(a)): dict1[a[i]]=0 try: tdata=input() for i in range(len(tdata)): if 'A'<=tdata[i]<='Z': dict1[tdata[i]]+=1 for key,value in dict1.items(): print(f'{key}:{value}') except EOFError: break