demo_ref_string_count2.py:
txt = "I love apples, apple are my favorite fruit" x = txt.count("apple", 10, 24) print(x)
➜ begtut>python demo_string_count2.py
1