message = 'python is popular programming language' # number of occurrence of 'p' print('Number of occurrence of p:', message.count('p')) >>> Number of occurrence of p: 4