title: How can I remove the brackets and the commas from this List. The purpose of this code is to give an output for each time that the element is shifted
body: <pre><code>#!/bin/python
  def insertionSort(list):
  
  for i in xrange(1,len(list)):
      value=list[i]
      pos=i
      while pos&gt;0 and value &lt;list[pos-1]:           
          list[pos]=list[pos-1]
          print list
          pos-=1
      list[pos]=value
  return list
  m = input()
  list = [int(i) for i in raw_input().strip().split()]
  insertionSort(list)
  </code></pre>
  
  <p>This is my output:</p>
  
  <pre><code>[2, 4, 6, 8, 8]
  [2, 4, 6, 6, 8]
  [2, 4, 4, 6, 8]
  </code></pre>
  
  <p>But I need  the same result but  without brackets and commas.</p>
  
  <pre><code>2 4 6 8 8
  2 4 6 6 8
  2 4 4 6 8
  2 3 4 6 8
  </code></pre>
  
  <p>I tried to use <code>print ' '.join(list)</code> but still didn't work. </p>