code: def strip_required_suffix(string, suffix):
      
      if string.endswith(suffix):
          return string[:-len(suffix)]
      raise AssertionError('String ends with %r, not %r' % (string[-len(suffix):], suffix))
docs: >>> strip_required_suffix('abcdef', 'def')
      'abc'
      >>> strip_required_suffix('abcdef', '123')
      Traceback (most recent call last):
      ...
      AssertionError: String ends with 'def', not '123'