I saw this Python code to show frequency of characters and I would like it to return frequency of strings but I am unable to do it right
def count_letters(text):
import string
result = {}
# Go through each letter in the text
for int in text:
# Check if the letter needs to be counted or not
if letter in string.ascii_letters:
letter = letter.lower()
if letter not in result:
result[letter] = 0
# Add or increment the value in the dictionary
result[letter] += 1
return result
print(count_numbers("This is a sentence.")) #Should be {}
print(count_numbers("55 North Center Drive")) #Should be {'5': 2}