Demystify email addresses and gain insights into user data with the Python Email Slicer. In this project, you’ll learn how to create a Python script that extracts and analyzes components of an email address.
Whether you’re a data analyst, marketing professional, or just curious about the information hidden in email addresses, this step-by-step guide will help you dissect and organize email data using Python. Join us in exploring the world of email slicing, and unraveling the mysteries of electronic communication through the power of Python!
import re
def isValidEmail(email):
# Regular expression for validating an Email
regex = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b'
if(re.fullmatch(regex, email)):
return True
else:
return False
email = input("Enter your email id - ")
if isValidEmail(email):
username = email[0:email.index('@')]
domain = email[email.index('@')+1: ]
print("Username - ", username)
print("Domain - ", domain)
else:
print("Invalid Email!")
Latest posts by Publisher (see all)
- Age calculator using Javascript, HTML & CSS - October 28, 2023
- Navigation bar using HTML & CSS - October 26, 2023
- Calculator using HTML, CSS & JS - October 26, 2023