Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python find string count in str

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
 
PREVIOUS NEXT
Tagged: #python #find #string #count #str
ADD COMMENT
Topic
Name
6+9 =