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
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)
Comments
Leave a comment