You can download this code by clicking the button below.
This code is now available for download.
This function uses the Person class from the Mimesis library to generate random names and domains, then combines them to form an email address.
Technology Stack : Mimesis, Python
Code Type : Generate random user emails
Code Difficulty : Intermediate
def generate_random_user_email():
import random
from mimesis import Person
def random_email(name, domain):
return f"{name.lower()}.{domain.lower()}"
person = Person()
first_name = person.first_name()
last_name = person.last_name()
domain = person.domain()
email = random_email(first_name, last_name)
return email