python how many times a char is in string code example Example: python count how many times a character appears in a string string.count('a')