Skip to content

Instantly share code, notes, and snippets.

@md2perpe
Last active March 21, 2020 21:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save md2perpe/9272491282d32069d9db663811bc3166 to your computer and use it in GitHub Desktop.
Save md2perpe/9272491282d32069d9db663811bc3166 to your computer and use it in GitHub Desktop.
################
known_domains = {
"hotmail.com": [],
"gmail.com": [],
"yahoo.com": [],
"mail.ru": [],
}
notfound = []
################
print("Enter five emails to test!")
for i in range(5):
data = raw_input("mail: ")
mail = data.lower()
domain = data.split("@")[1]
if domain in known_domains:
known_domains[domain].append(mail)
print "Domain '%s'" % domain
else:
notfound.append(mail)
print "Domain not found"
print ""
print "Gmail:", known_domains["gmail.com"]
print "Hotmail:", known_domains["hotmail.com"]
print "Yahoo:", known_domains["yahoo.com"]
print "Mail.ru:", known_domains["mail.ru"]
print "Not found:", notfound
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment