title: Read output of a csv file and write it to a text file using Python
body: <p>I have a python file where I get user inputs for student database and I have written them as a csv file. I couldn't get the links in google to read the csv output and write those csv output to a text file.</p>
  
  <p>Sample Csv output:</p>
  
  <pre><code>Name    Roll no Age Mark1   Mark2
  a        1       2    3       4
  g        3      54    54      3
  </code></pre>
  
  <p>import csv</p>
  
  <pre><code>with open('abc.csv','r') as f:
      reader=csv.dictreader(f)
      for row in reader:
          output=('xyz.txt','r')
  </code></pre>
  
  <p>I know how to read a csv file but I don't know how to write those contents to a text file</p>