Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2uestion 1 (4 points): Purpose: To practice slicing and using string methods Degree of Difficulty: Easy An email address is a sequence of characters with

image text in transcribed
2uestion 1 (4 points): Purpose: To practice slicing and using string methods Degree of Difficulty: Easy An email address is a sequence of characters with the following structure: - it contains exactly one character - there are 1 or more characters before the (3). We call these characters the username - There is at least one period (.) SOMEWHERE after the @ - IMMEDIATELY after the @ there are one or more characters that are NOT periods. We call all the characters in between the (a) and the first-period-after-the-(a) the domain - The last section after the last period is called the Top Level Domain or TLD For this question, you will write a program that lets the user type in a valid email address, and reports the username and TLD components of that address. Your program may assume that the user always types a correctly-formatted email address. Hint: Tools such as slicing and the string method ifind() or .rfind() will probably be the most useful here. Sample Runs Here is one possible sample run. Green text was entered by the user, and the blue text is based on that input. Enter email addrees : anhepokemon. kanto.jp Username : ash TLD: jp Here is another one. What to Hand In Hand in your solution in a file called a2q1v1.py. The version number (v1) portion of the file names must be changed to v2, v3 etc. each time you resubmit your assignment. Remember to include all your solution files each time you submit/resubmit your assignment

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

Semantics In Databases Second International Workshop Dagstuhl Castle Germany January 2001 Revised Papers Lncs 2582

Authors: Leopoldo Bertossi ,Gyula O.H. Katona ,Klaus-Dieter Schewe ,Bernhard Thalheim

2003rd Edition

3540009574, 978-3540009573

More Books

Students also viewed these Databases questions