Returns a tuple containing the left part of the string split by the specified separator, the separator itself and the right part of the string (starting from right).
str. rpartition(sep)
- sep
- Required. Separator for the returned tuple. If the separator is not found, partition returns a 3-tuple containing two empty strings, followed by the string itself.
tuple
#TODO
>>> "AB-CD-EF".rpartition('-')
('AB-CD', '-', 'EF')
>>> "AB-CD-EF".rpartition(' ')
('', '', 'AB-CD-EF')
>>> "AB-CD-EF".rpartition('D')
('AB-C', 'D', '-EF')>>> "image.png".rpartition('.') # this example breaks image file-path into its components
('image', '.', 'png')