Answer to Question #321129 in Python for shaves

Question #321129

python program that needs to ask the user for her or his email address in the formatfirstname.lastname@bahria.edu.pk OR firstname.lastname@gmail.com. The application takes asinput this email address, parses the email and replies to the user with first name, last name and hostname


1
Expert's answer
2022-03-30T15:48:47-0400
email = input("Enter e-mail:")
ind = email.index(".")
at = email.index("@")
fname = email[0:ind]
lname = email[ind+1:at]
domain = email[at+1:]
print ("First Name: ",fname)
print ("Last Name: ",lname)
print ("Host Name: ",domain)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS