title: While loops doesn't work inside a with block
body: <p>I'm trying to print out the content of a 'txt' file.
  My code:</p>
  
  <pre><code>filename = 'I_learned'
  n = 0
  with open(filename) as file:
    while n == 3:
      print(file.read())
      n += 1
  </code></pre>
  
  <p>When I run the code:</p>
  
  <pre><code>atizva@atizva0:~/Documents/Python coding/Programs$ python I_learned.py
  atizva@atizva0:~/Documents/Python coding/Programs$ 
  </code></pre>
  
  <p>Nothing runs.
  I don't get where my mistake is at? Isn't it supposed to show the content of the file 3 times? Thanks in advance.</p>