You Want Chocolate?

Limits: 1s, 256 MB

Bear Limak is very much fond of chocolate. His mom wants her son to study hard and develop his skills. So she decided to give some tasks to her son. She offers Limak that if he can solve those tasks, then she will give him a chocolate as a reward. The task is, she will give him a string S. Limak has to find out which character appeared how many times in the given string.


This is a companion discussion topic for the original entry at https://toph.co/p/you-want-chocolate

What is the problem?
Why getting WA on 2nd test case???

for x in range(int(input())):
    n=int(input())
    s=input()
    l=set()
    if s=='':
        print(-1)
        continue
    print("Case %d:"%(x+1))
    for y in s:
    	l.add(y)
    l=sorted(l)
    for y in l:
        if y not in [' ','!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_', '`', '{', '|', '}', '~']:
            print("%s - %s"%(y,s.count(y)))
    print()