count occurrences of each character in string python without methos code example Example: python count character occurrences str1.count("a")