How to find all occurrences of a substring in a String in Python

1 Answer

0 votes
str = "python c c++ python php java python"

substr = "python"

print(str.count(substr))






'''
run:

3

'''

 



answered Feb 19, 2022 by avibootz
...