title: how to write and append loop output in a csv file using python
body: <p>I want to store elements in a csv file using loops, for example,</p>
  
  <pre><code>  for i in range(0,10):
        #I want to append each i values in new rows of that csv file.
  </code></pre>
  
  <p>The output final csv file with look like,</p>
  
  <pre><code>   0       
     1
     2
     3
     4
     5
     7 
     8
     9
  </code></pre>
  
  <p>How to do it in efficient way ?</p>