Question: Python 3: Write function emails() that takes a document (as a string) as input and returns the set of email addresses (i.e., strings) appearing in
Python 3: Write function emails() that takes a document (as a string) as input and returns the set of email addresses (i.e., strings) appearing in it. You should use a regular expression to find the email addresses in the document.
>>> from urllib.request import urlopen
>>> url = 'http://www.cdm.depaul.edu'
>>> content = urlopen(url).read().decode()
>>> emails(content)
{'advising@cdm.depaul.edu', 'wwwfeedback@cdm.depaul.edu', 'admission@cdm.depaul.edu', 'webmaster@cdm.depaul.edu'}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
