code: def rindex(self, sub, *args):
          '''
          S.rindex(sub [,start [,end]]) -> int
  
          Like S.rfind() but raise ValueError when the substring is not found.
          '''
          pos = self.rfind(sub, *args)
          if pos == -1:
              raise ValueError('substring not found'f rindex(self, sub, *args):
          '''
          S.rindex(sub [,start [,end]]) -> int
  
          Like S.rfind() but raise ValueError when the substring is not found.
          '''
          pos = self.rfind(sub, *args)
          if pos == -1:
              raise ValueError('substring not found')
docs: S.rindex(sub [,start [,end]]) -> int
  
          Like S.rfind() but raise ValueError when the substring is not found.