Q. Which method counts occurrences of a substring?

A
count()
B
find()
C
index()
D
occur()
Solution:

count() returns the number of occurrences, e.g., ‘aaa’.count(‘a’) = 3.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!