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 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
Step: 1
You can create a Python script to collect domain names from valid email addresses as described ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started