demo_ref_string_rpartition2.py:
txt = "I could eat bananas all day, bananas are my favorite fruit" x = txt.rpartition("apples") print(x)
➜ begtut>python demo_string_rpartition2.py
('I could eat bananas all day, bananas are my favorite fruit', '', '')