#ASk to enter any email
email = input("Enter Your Email: ")
#remove any unnecessary white spaces
email=email.strip()
#Get the index of @
slicer_index=email.index("@")
#fetch the user name by string slicing
username = email[:slicer_index]
#fetch the domain name by string slicing
domain_name = email[slicer_index+1:]
#print the result separatly
print("Your user name is ",username," and your domain is ",domain_name)
#clcoding.com
Enter Your Email: pythonclcoding@gmail.com Your user name is pythonclcoding and your domain is gmail.com
0 Comments:
Post a Comment