def remove_if_starts_with(haystack, needle):
    """
    Removes needle from haystack if haystack starts with needle.
    Haystack remains unchanged otherwise.

    print(remove_if_starts_with("python", "py"))  # thon
    print(remove_if_starts_with("python", "pyx"))  # python

    :type haystack: str
    :type needle: str
    """
    assert isinstance(haystack, str)
    assert isinstance(needle, str)
    if haystack.startswith(needle):
        haystack = haystack[len(needle):]
    return haystack