Important Notice:

Course Content
The Calendar Module
Library Function/Predefined Functions
0/4
Sys Module
Library Function/Predefined Functions
0/2
OS Module
Library Function/Predefined Functions
0/2
Functions in Python (Chapter-10) M3-R5
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

error: Content is protected !!