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