I’m getting a syntax error on the 2nd to last line here, but don’t know why. It seems identical to the line 2 lines before it, but for some reason I’m getting a syntax error. I’ve tried it both with and without a blank line between it and the line before it, with the same results.
## numlist = some list
array_size = 20
for row in xrange(array_size):
for col in xrange(array_size):
if(col<=(array_size-4)):
check(sum(numlist[row][col:col+4])
if(row<=(array_size-4)):
check(sum([numlist[row+i][col] for i in range(4)]))
You are missing a closing
')'for the statement below the firstif-statement.should be
Note: Using an editor with the feature that matches/highlights parens is a very useful tool to have and will save you from spending time finding these sort of errors.