title: How do I print a 2d array in python
body: <p>I'm having problems printing this 2d array for my Battleship game. </p>
  
  <pre><code>class Battleship:
  
      def __init__(self):
         self.__init__()
  
      def board(self, locate):
          locate = []
          for i in range(10):
              locate.append([])
              for j in range(10):
                  locate[i].append(0)
  
          for i in range(10):
              for j in range(10):
                  locate[i][j] = '%s,%s'%(i,j)
                  print(locate)
  </code></pre>
  
  <p>I found how to initialise the array here: <a href="https://stackoverflow.com/questions/24023115/how-to-initialise-a-2d-array-in-python">How to initialise a 2D array in Python?</a>
  This is where I found the code sample to iterate over the 2d array, but it doesn't work for me:
  <a href="https://stackoverflow.com/questions/16548668/iterating-over-a-2-dimensional-python-list">Iterating over a 2 dimensional python list</a></p>
  
  <p>Can you give me some help please?</p>