python number of occurenceq in str code example Example: python count character occurrences str1.count("a")