About Lesson
Count:-
count returns the number of times a specified value occurs in a string.
Syntax:- string.count(substring, start, end)
st=”I Love Python programming language” a=st.count(“Python”) print(a) Output 1
|
st=”I Love Python Programming Language” a=st.count(“P”) print(a) b=st.count(‘P’,5,50) print(b) Output 2 2 |