How to count the number of times (occurrences) a word appears in part of a string with Python

1 Answer

0 votes
s = "Python is an interpreted, is high-level, is general-purpose programming language."

c = s.count("is", 6, 20)

print(c)


'''
run:

1

'''

 



answered Dec 20, 2018 by avibootz
edited Dec 20, 2018 by avibootz
...