title: 'Return' keyword returns only one element from a loop?
body: <p>I have a simple function to read the csv file and extracts the first coloum from it:</p>
  
  <pre><code>import csv 
  
  def pass_username():
      with open('test.csv', 'r') as csvfile:
          spamreader = csv.reader(csvfile, delimiter=',')
          for row in spamreader:
              return row[0]
  </code></pre>
  
  <p>When I call this function as:</p>
  
  <pre><code>a = pass_username()
  print a 
  </code></pre>
  
  <p>This only prints the first element. However, when I replace <code>return</code> word with <code>print</code> as <code>print row[0]</code> and call the function as <code>pass_username()</code> it prints all the elements. I want to assign that function to a variable thus I want to use return. How to fix it?</p>
  
  <p>Content of test.csv:</p>
  
  <pre><code>"test@gmail.com","rockon"
  "hello@gmail.com","hey"
  "hithere@gmail.com","ok"
  "hellosir@gmail.com","password"
  </code></pre>