Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, In Python, I am trying to create a function that will return the domain name from any inputted email address. For example, my input

Hello,

In Python, I am trying to create a function that will return the domain name from any inputted email address. For example, my input of john@domainname.com would return just the domainname. It needs to be done using regular expressions and the map function. I'm still stuck on trying to get the correct parameters for regular expression and also what is throwing it off. Thank you for your help!

I am currently working with a list of different email addresses named email_list and my code thus far looks like:

def domain(email): a = re.findall('\S+@\S+', email_list) return(a)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions

Question

How is a CFD contract terminated?

Answered: 1 week ago

Question

Conduct an effective performance feedback session. page 360

Answered: 1 week ago