check how many times something appears in a string python code example Example: python count character occurrences str1.count("a")