Python : populate a new column with an if/else statement
<p>I have a csv file composed of three column.</p>

<p>My goal is to add a fourth column and populate it with a statement based on my columns n°2 and n°3.</p>

<p>Here is the beginning of my code : </p>

<pre><code>import csv, sys, locale, operator

abord = "/home/julien/csv/ABORD.csv"
file1 = open (abord, 'rb')
reader1 = csv.reader (file1, delimiter = ';', quotechar=' ')

next(reader1) 
for row1 in reader1:
    ID = row1 [0]
    LARG_1 = row1 [1]
    LARG_2 = row1 [2]
</code></pre>

<p>And I want to make things like that :</p>

<pre><code>if LARG_1 &gt; 10 and LARG_2 &lt;20:
    print "result OK" in a fourth column "CONTROL"
else:
    print "result fail" in the fourth column "CONTROL"

then save the csv, nom composed of 4 columns
</code></pre>

<p>Do you know how I could do it ? Thank you !</p>
