title: Unsupported operation :not writeable python
body: <p>Email validation</p>
  
  <pre><code>#Email validator
  import re
  
  
  def is_email():
      email=input("Enter your email")
      pattern = '[\.\w]{1,}[@]\w+[.]\w+'
      file = open('ValidEmails.txt','r')
      if re.match(pattern, email):
          file.write(email)
  </code></pre>
  
  <p>I am wondering why my data wont write to the disk. Python says that my operation is not supported.</p>
  
  <pre><code>is_email
      file.write(email)
  io.UnsupportedOperation: not writable
  </code></pre>