Count English Letters in Text

  • Share this:

Code introduction


Counts the occurrences of each English letter from 'a' to 'z' in the input text.


Technology Stack : String manipulation

Code Type : Function

Code Difficulty :


                
                    
def a_to_z_count(text):
    def counter(char):
        return text.count(char)

    return {char: counter(char) for char in 'abcdefghijklmnopqrstuvwxyz'}