Email validation
#Email validator import re def is_email(): email=input(\"Enter your email\") pattern = \'[\\.\\w]{1,}[@]\\w+[.]\\w+\' file = o
You open the variable "file" as a read only then attempt to write to it:
file = open('ValidEmails.txt','r')
Instead, use the 'w' flag.
file = open('ValidEmails.txt','w') ... file.write(email)