python function to count occurrences of word in string code example Example: python count character occurrences str1.count("a")