Another straightforward-enough string question with interesting counting application examples.
from collections import defaultdict
def duplicate_count(text):
d = defaultdict(int)
for c in text:
c = c.lower()
d[c] += 1
res = 0
for k in d:
if d[k] > 1:
res += 1
return res