title: Python error message io.UnsupportedOperation: not readable
body: <p>I have this code:</p>
  <pre><code>line1 = []
  line1.append(&quot;xyz &quot;)
  line1.append(&quot;abc&quot;)
  line1.append(&quot;mno&quot;)
      
  file = open(&quot;File.txt&quot;,&quot;w&quot;)
  for i in range(3):
      file.write(line1[i])
      file.write(&quot;\n&quot;)
  
  for line in file:
      print(line)
  file.close()
  </code></pre>
  <p>But when I try it, I get an error message like:</p>
  <pre><code>  File &quot;...&quot;, line 18, in &lt;module&gt;
       for line in file:
   
  UnsupportedOperation: not readable
  </code></pre>
  <p>Why? How do I fix it?</p>