def supersequence(x, y):
    """ True if and only if all elements in y occur in x in order (x is a supersequence of y)"""
    idx = 0
    try:
        for i in y:
            idx = x.index(i, idx)+1
    except ValueError, e:
        return False
    return True
 True if and only if all elements in y occur in x in order (x is a supersequence of y)
recipes/Python/578678_Shortest_CommSupersequence/recipe-578678.py