The count() method returns the number of occurrences of a substring in the given string. l='abcba' l.count('a')