title: How can I turn random matrix into a table?
body: <p>Here is the code I'm given.</p>
  
  <pre><code>import random
  
  def create_random_matrix(rows_min, rows_max, cols_min, cols_max):
      matrix = []
  
      # generate a random number for the number of rows
      # notice that randint works differently from similar functions
      # you have seen in that rows_min and rows_max are both inclusive
      # http://docs.python.org/3/library/random.html#random.randint
      rows = random.randint(rows_min, rows_max)
  
      for row in range(rows):
          # add a row to the matrix
          matrix.append([])
  
          # generate a random number for the number of columns
          cols = random.randint(cols_min, cols_max)
  
          # generate a random number between 1 and 100 for each
          # cell of the row
          for col in range(cols):
          matrix[row].append(random.randint(1, 100))
  
      # done
      return matrix
  
  def print_matrix(twod_list):
      print(twod_list)
  
  if __name__ == "__main__":
  
      random_matrix = create_random_matrix(8, 12, 3, 7)
  
      print_matrix(random_matrix)
  </code></pre>
  
  <p>The code creates a random matrix like this:</p>
  
  <blockquote>
    <blockquote>
      <blockquote>
        <p>[[52, 23, 11, 95, 79], [3, 63, 11], [5, 78, 3, 14, 37], [89, 98, 10], [24, 60, 80, 73, 84, 94], [45, 14, 28], [51, 19, 9], [43, 86, 63, 71, 19], [58, 6, 43, 17, 87, 64, 87], [77, 57, 97], [9, 71, 54, 20], [77, 86, 22]]</p>
      </blockquote>
    </blockquote>
  </blockquote>
  
  <p>But how can I change the code to output something like this instead?</p>
  
  <p>36 83 35 73</p>
  
  <p>28 11 3 45 30 44</p>
  
  <p>39  97  3  10  90  5  42</p>
  
  <p>55  73  56  27  7  37</p>
  
  <p>84  49  35  43</p>
  
  <p>100  20  22  95  75  25</p>
  
  <p>58  81  26  34  41  44  72</p>
  
  <p>32  23  21</p>
  
  <p>31  37  1</p>
  
  <p>95  90  26  6  78  49  22</p>
  
  <p>5  17  31</p>
  
  <p>86  25  73  56  10</p>