how to fet the number of occurrences for a character in astring in python code example
Example 1: count characters in string python
>>> sentence = 'Mary had a little lamb'
>>> sentence.count('a')
4
Example 2: python count character occurrences
str1.count("a")