Created
May 3, 2019 19:32
-
-
Save sayantanHack/4a897865cf85886c8efbeb1a06013e37 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import email.utils as eu | |
num = int(raw_input("")) | |
lst=[] | |
for i in range(num): | |
f = raw_input("") | |
li = eu.parseaddr(f) | |
unm = li[1].split("@")[0] | |
dom = li[1].split("@")[1].split(".")[0] | |
ext = li[1].split("@")[1].split(".")[1] | |
if(unm.isalum()==True): | |
if((dom>='a' and dom<='z') or (dom>='A' and dom<='Z')): | |
if((len(ext)==1 or len(ext)==2 or len(ext)==3) and ((dom>='a' and dom<='z') or (dom>='A' and dom<='Z'))): | |
lst.append(f) | |
elif(('.' in unm== True) or ('-' in unm== True) or ('_' in unm== True)): | |
if((dom>='a' and dom<='z') or (dom>='A' and dom<='Z')): | |
if((len(ext)==1 or len(ext)==2 or len(ext)==3) and ((dom>='a' and dom<='z') or (dom>='A' and dom<='Z'))): | |
lst.append(f) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment