Question: Create a script that asks the user for five email addresses and collects the domain names. Input Prompt the user five times to enter an

Create a script that asks the user for five email addresses and collects the domain names.

Input

Prompt the user five times to enter an email address. If the address does not include a "@" before a ".", it is not valid and does not count toward the five addresses.

Output

After each valid email, print just the domain name portion of the address without the extension. For example, "myname@yahoo.com" should output as "yahoo".

Once all five emails have been entered, all valid domain names should be printed again in one line, separated by spaces.

Example Program Run

This is an example of what the screen might look like after the program executes, including bold values that were input by the user.

Enter email address: someone@yahoo.com yahoo Enter email address: noone@wctc.edu wctc Enter email 

Enter email address: someone@yahoo.com yahoo Enter email address: noone@wctc.edu wctc Enter email address: bad Invalid email address Enter email address: another@yahoo Invalid email address Enter email address: yet.another@msn.com msn Enter email address: myname@yahoo.com yahoo Enter email address: lastaddy@yahoo.com yahoo yahoo wctc msn yahoo yahoo

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

You can create a Python script to collect domain names from valid email addresses as described ... View full answer

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 Programming Questions!