get nbr of occurenses of char in string python code example Example: python count character occurrences str1.count("a")