def swap_stops(tour, steps):
    """
    This swaps two stops in a tour, the two stops are given by `steps`.
    """
    i, j = sorted(steps)
    new_tour = tour[:i] + tour[i : j + 1][::-1] + tour[j + 1 :]
    return new_tour