python function to get number of char code example Example: python count character occurrences str1.count("a")