Python ProgrammingPython Programming

Python compare two strings retain difference from one end

def after(s1, s2):
    index = s1.find(s2)
    if index != -1 and index + len(s2) < len(s1):
        return s1[index + len(s2):]
    else:
        return None

s1 = "canada"
s2 = "can"

print(after(s1, s2))
Output
ada