demo_ref_string_rpartition.py:
txt = "I could eat bananas all day, bananas are my favorite fruit" x = txt.rpartition("bananas") print(x)
C:\Users\My Name>python demo_string_rpartition.py
('I could eat bananas all day, ', 'bananas', ' are my favorite fruit')