Store all cells of middle row within column number range
for i in range ( MinCol , int ( Maxcol ) + 1 ) : NEW_LINE INDENT s . add ( ( MidRow , i ) ) NEW_LINE DEDENT for i in range ( 3 ) : NEW_LINE INDENT if ( v [ i ] [ 0 ] == MidRow ) : NEW_LINE INDENT continue ; NEW_LINE DEDENT DEDENT