Created
November 8, 2015 12:51
-
-
Save sholfen/775a824da2121df04b7d to your computer and use it in GitHub Desktop.
To count email domain
This file contains hidden or 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
email_string = '[email protected];[email protected];[email protected]' | |
emails = email_string.split(';') | |
print emails | |
email_domains = {} | |
for email in emails: | |
domain = email.split('@')[1].strip() | |
if domain in email_domains: | |
email_domains[domain] += 1 | |
else: | |
email_domains[domain] = 1 | |
print email_domains |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment