This is a simple python app that takes a lists of emails and separate the username and the domain name.
First let's create a list with some dummy emails.
Create a for loop to visit each email from the list.
Each time the loop executes, it will split the email into two separate parts based on '@'
The first part is the username and the second part is the domain name. And the program will print it out.
lst = ["firstname.lastname@example.org","email@example.com"] for i in lst: split = i.split('@') domain = split user = split print("username : ",user) print("domain : ", domain) print("\n")
username : random1
domain : gmail.com
username : random2
domain : yahoo.com