title: How to use for loop with boolean expression?
body: <p>I need to loop over nested lists and check the position of # in the list. I am using NWES(north, west, east, south) coordinates. So W should return False (because # is in that certain position), E should be True and S should also be True. I want to loop over every letter and get boolean expression for each of them. Problem is that I get False for W and it ignores E and S.
  Dont know if there is indentation problem or something else.</p>
  
  <pre><code>def something(can_mine, moves) -&gt; bool:
      """"""
      for i in range(len(can_mine)):
          for j in range(len(can_mine[0])):
              for k in moves:
  
                  if can_mine[j][-1] == '#' and k == 'E':
                      return False
                      #
                  elif can_mine[j][0] == '#' and k == 'W':
                      return False
                      # N works
                  elif can_mine[0][j] == '#' and k == 'N':
                      return False
                      # S works
                  elif can_mine[-1][j] == '#' and k == 'S':
                      return False
                  else:
  
                      return True
  
  
  if __name__ == '__main__':
      print(something([['#', '.', '.', 'x'], ['.', '.', 'x', '.'], ['.', '.', 'X', 's'], ['.', '.', 'x', 'x']], 'WES' ))
  
  What i need is something like that:
  False
  True
  True
  What I get is:
  False (which is ok)
  False (should be True)
  False ( should be True)
  </code></pre>