title: Invalid Syntax: function doesn't return value
body: <p>I get an Invalid Syntax error for my code, but I have no idea why.
  My code should create a 2 dimensional list of zeroes and then change one of the zeros to a one, and check certain list values, to see if it will return the 1, or just zeros.
  I define a function that should return a list of the adjacent cell values, but for some reason the syntax error arises. Here is my code:</p>
  
  <pre><code>def test(x,y):
      spotX = [(x-1)%height,0,(x+1)%height]
      spotY = [(y-1)%height,0,(y+1)%height]
      val = []
      for a in range(3):
          for b in range(3):
              if a and b != 2:
                  val.append(newBoard[spotX[a]][spotY[b]]
      return val
  </code></pre>
  
  <p>The syntax error is that "return val" line.</p>