Determining if the movement of a robot is possible in a row
First, you are defining too many variables.  Instead of making a list of tuples and then converting it to a flattened list with a different name, you should make the list out of numbers in the first place.  It would also be better to use a set instead of a list.  Your if statement is a little odd.  not j &lt;= i is the same as j &gt; i, but harder to read.  If j must be greater than i, why does your first check include abs()?  Since j &gt; i is an easier operation than the other check, it should come first.  That way, if it is False, the other check won't even be evaluated and the whole thing is more efficient.  You could also use a comprehension instead of a four-line for loop:

def row_walk(matrix):
    used = set()
    for i, r1 in enumerate(matrix):
        for j, r2 in enumerate(matrix):
            if j &gt; i and r1+r2 == j-i:
                used.update((i, j))
    return [x for x in range(len(matrix)) if x not in used]


If you can use a set instead of a list, you can use a better return statement:

return used.symmetric_difference(range(len(matrix))


This all assumes that you are using Python 3.  If you are using Python 2, use xrange() instead of range().  Although range() still exists in Python 2, it creates a list instead of an iterator.