title: Automate The Boring Stuff With Python: Chapter 4 Practice Project II
body: <p>I've been thru d comments for an almost similar question but there's no solution to solve my little problem. </p>
  
  <p>My code seems to work but i still get 'IndexError: List index out of range'.</p>
  
  <p>This is my code:</p>
  
  <pre><code>grid = [['.', '.', '.', '.', '.', '.',],\
  ['.', 'O', 'O', '.', '.', '.',],\
  ['O', 'O', 'O', 'O', '.', '.',],\
  ['O', 'O', 'O', 'O', 'O', '.',],\
  ['.', 'O', 'O', 'O', 'O', 'O',],\
  ['O', 'O', 'O', 'O', 'O', '.',],\
  ['O', 'O', 'O', 'O', '.', '.',],\
  ['.', 'O', 'O', '.', '.', '.',],\
  ['.', '.', '.', '.', '.', '.',]]
  def fish():
      m = 0
      n = 0
      while m != len(grid):
          print (grid[m][n] + \
          grid[m+1][n] + \
          grid[m+2][n] + \
          grid[m+3][n] + \
          grid[m+4][n] + \
          grid[m+5][n] + \
          grid[m+6][n] + \
          grid[m+7][n] + \
          grid[m+8][n])
          n = n+1
  fish() 
  </code></pre>