python program for polymorphism with function to find histogram to count the number of times each letter apppears in a word and in sentence code example
Example: python codes for counting the occurrence of a letters in dictionary excluding digits
def count_letters(text):
result = {}
for letter in text:
if letter not in result:
result[letter.lower()] = 1
else:
result[letter.lower()] += 1
return result
print(count_letters("AaBbCc"))
print(count_letters("Math is fun! 2+2=4"))
print(count_letters("This is a sentence."))