Sobes.tech
Intern — Middle

Removing the initial prefix from a string

livecode

Task condition

Implement a function that checks whether the string source starts with the substring pre. If it does, return the string without this prefix; otherwise, return the original string unchanged.

def subtract_prefix(source: str, pre: str) -> str:
    # TODO
    pass