title: How to print every nth index of a python list on a new line?
body: <p>I'm trying to print out a list and for every 5 indexes, it prints a new line. So for example, if I have:</p>
  
  <pre><code>  [1,2,3,4,5,6,7,8,9,10]
  </code></pre>
  
  <p>the output would be:</p>
  
  <pre><code>  1 2 3 4 5
    6 7 8 9 10
  </code></pre>
  
  <p>I tried this so far:</p>
  
  <pre><code>   lst = [1,2,3,4,5,6,7,8,9,10]
  
     for i in lst:
         if len(lst) &gt; 5:
            print(lst,'\n')
  </code></pre>
  
  <p>but all I get is:</p>
  
  <pre><code>   [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] 
  
     [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] 
  
     [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] 
  
     .......
  </code></pre>
  
  <p>How could I do this?</p>
  
  <p>Thanks for the help!</p>