def rpartition(s, t):
 i = s.rfind(t)
 if (i != (-1)):
  return (s[:i], s[(i + len(t)):])
 return ('', s)

def rpartition ( s , t ) : i = s . rfind ( t ) if ( i != ( - 1 ) ) : return ( s [ : i ] , s [ ( i + len ( t ) ) : ] ) return ( '' , s )
similar to str .