title: Print list elements on new line
body: <p>I wish to print the elements of an array, without commas, and on separate lines. I am writing a function for insertion sort. Though it works correctly, I am finding it tricky to print them properly. The code I've written is:</p>
  
  <pre><code>#!/bin/python
  def insertionSort(ar):    
      newNo = ar[-1]
      for i in range(0, m-1):
          if(newNo &lt; ar[m-i-1]):
              ar[m-i] = ar[m-i-1]
              for e in ar:
                  print e,
              print '\n'
      ar[m-i-1] = newNo
      for f in ar: print f,
  
  m = input()
  ar = [int(i) for i in raw_input().strip().split()]
  insertionSort(ar)
  </code></pre>
  
  <p>The output I get is:</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 should get the following output for the code to pass the test case:</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.e without the extra space between lines. Click <a href="https://www.hackerrank.com/challenges/insertionsort1">here</a> for the detailed problem statement.</p>