def strip_required_prefix(string, prefix):
    """
    >>> strip_required_prefix('abcdef', 'abc')
    'def'
    >>> strip_required_prefix('abcdef', '123')
    Traceback (most recent call last):
    ...
    AssertionError: String starts with 'abc', not '123'
    """
    if string.startswith(prefix):
        return string[len(prefix):]
    raise AssertionError('String starts with %r, not %r' % (string[:len(prefix)], prefix))
>>> strip_required_prefix('abcdef', 'abc')
    'def'
    >>> strip_required_prefix('abcdef', '123')
    Traceback (most recent call last):
    ...
    AssertionError: String starts with 'abc', not '123'