ascii_counts = [0] * 255
s = 'abracadabra'
for c in s:
    ascii_counts[ord(c)] += 1
for i, e in enumerate(ascii_counts):
    if e:
        pass
Nested for-loops and dictionaries in finding value occurrence in string