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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!