My code adds the letters together. But I only need to count the number of letters.
For example, for the input string "a12a", the output will be 2 because there are 2 letters.
def countingletters(st):
empty = []
for i in st:
if i.isalpha():
empty += str(i)
return empty
my_string = 'a12a'; sum(c.isalpha() for c in my_string)