EMAIL SLICER USING PYTHON
Source Code:-
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 | # Email Slicer using Python# input the email email = input("Enter your Email adress: ").strip()# Slice out the user nameuser_name = email[:email.index("@")]# Slice out the domain namedomain_name = email[email.index("@") + 1:]slice_data = f"Your username is: {user_name} \nYour domain name is: {domain_name}"# Display the result messageprint(slice_data)# Output:-# Enter your Email adress: sainishuham915@gmail.com# Your username is: sainishuham915# Your domain name is: gmail.com |
# Email Slicer using Python
# input the email
email = input("Enter your Email adress: ").strip()
# Slice out the user name
user_name = email[:email.index("@")]
# Slice out the domain name
domain_name = email[email.index("@") + 1:]
slice_data = f"Your username is: {user_name} \nYour domain name is: {domain_name}"
# Display the result message
print(slice_data)
# Output:-
# Enter your Email adress: sainishuham915@gmail.com
# Your username is: sainishuham915
# Your domain name is: gmail.com

0 Comments