title: Define row of CSV file if row contains specific string
body: <p>I've been studying Python for two weeks and there's something I want to know when reading and writing CSV file in Python.</p>
  
  <p>I used <code>def</code> codes for output:</p>
  
  <pre><code>def csv(filename):
    f = open(filename, 'rU') 
    lines = []
    for line in f:
      lines.append(line.rstrip('\n').split(','))
  f.close()
  return lines
  </code></pre>
  
  <p>And the result from above codes looks like:</p>
  
  <blockquote>
    <p>[['a', '', '', '', '', ''], </p>
    
    <p>['b', '', '', '', '', ''], </p>
    
    <p>['c', '', '', '', '', ''],</p>
    
    <p>['d', '', '', '', '', ''], </p>
    
    <p>['e', '', '', '', '', ''],</p>
    
    <p>['f', '', '', '', '', ''], </p>
    
    <p>['g', '', '', '', '', '']]</p>
  </blockquote>
  
  <p>Let's say I want to change the value of first row that contains <code>'a'</code>.</p>
  
  <p>What codes can I use to define the row containing <code>a</code>?</p>