demo_ref_string_count.py:
txt = "I love apples, apple are my favorite fruit" x = txt.count("apple") print(x)
C:\Users\My Name>python demo_string_count.py
2