title: Read file in Python
body: <p>I am new to Python and trying to learn the language structure.</p>
  
  <p>I understand how <code>for</code> statement and <code>open</code> function work. But cannot explain how this piece of code works, which dumps the content of file sample_log.txt to screen:</p>
  
  <pre><code>for line in open("sample_log.txt"):
      print line
  </code></pre>
  
  <p>These are my questions:</p>
  
  <ol>
  <li>Does <code>open</code> return a list?</li>
  <li>When the file actually gets read to memory?</li>
  <li>Does the file gets read line by line or all at once?</li>
  </ol>