split in last specific character python code example
Example 1: python reverse split only once
s.rsplit(',', 1)
s.rpartition(',')
Example 2: rsplit string from last
'sayanand'.rsplit('a', 2)
>>> ['say', 'n', 'nd']
s.rsplit(',', 1)
s.rpartition(',')
'sayanand'.rsplit('a', 2)
>>> ['say', 'n', 'nd']