Random Email Generator

  • Share this:

Code introduction


This function generates a random email address. It creates an email by combining a random first name, last name, and a random domain.


Technology Stack : Mimesis

Code Type : Function

Code Difficulty : Intermediate


                
                    
import random
from mimesis import Person, Address, Internet

def generate_random_email():
    """
    Generates a random email address.
    """
    first_name = Person.first_name()
    last_name = Person.last_name()
    domain = Internet.domain_name()
    email = f"{first_name.lower()}.{last_name.lower()}@{domain}"
    return email                
              
Tags: