Answer to Question #283806 in Python for Nick

Question #283806

Write a program in python to display the output in the following format?

Take the input from user:

Name Age Email Address

John Doe 23 John@gmail.com

William Edward 30 William@gmail.com


1
Expert's answer
2021-12-30T15:17:48-0500
email = input("Enter Your Email: ").strip()
username = email[:email.index('@')]
domain = email[email.index('@') + 1:]
print(f"Your username is {username} & domain is {domain}")
username, _, domain = input("Enter Your Email: ").strip().partition("@")
print(f"Your username is {username} & domain is {domain}")
def email_slicer(email):
    username, _, domain = email.strip().partition("@")
    return f"Your username is {username} & domain is {domain}"
user_input = input("Enter Your Email: ")
print(email_slicer(user_input))

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