demo_ref_string_count.py:
txt = "I love apples, apple are my favorite fruit" x = txt.count("apple") print(x)
➜ begtut>python demo_string_count.py
2