From 2ad55f037d71aa882145fe98ee68a4f7e9fa9287 Mon Sep 17 00:00:00 2001 From: skillbasket Date: Sun, 26 Nov 2023 13:03:02 +0530 Subject: [PATCH] Email_slicer created --- Email_slicer/Email_slicer.py | 18 ++++++++++++++++++ Email_slicer/Read.md | 22 ++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 Email_slicer/Email_slicer.py create mode 100644 Email_slicer/Read.md diff --git a/Email_slicer/Email_slicer.py b/Email_slicer/Email_slicer.py new file mode 100644 index 0000000..9b4ded8 --- /dev/null +++ b/Email_slicer/Email_slicer.py @@ -0,0 +1,18 @@ +def extract_email_info(email): + # Split the email address into username and domain + username, domain = email.split('@', 1) + return username, domain + +def main(): + # Get email address from user input + email_address = input("Enter an email address: ") + + # Extract username and domain + username, domain = extract_email_info(email_address) + + # Output the results + print(f"Username: {username}") + print(f"Domain: {domain}") + +if __name__ == "__main__": + main() diff --git a/Email_slicer/Read.md b/Email_slicer/Read.md new file mode 100644 index 0000000..20545c2 --- /dev/null +++ b/Email_slicer/Read.md @@ -0,0 +1,22 @@ +# Email Address Slicer + +This Python script takes an email address as input and extracts the username and domain. It's a basic utility to break down an email address into its components. + + +## Run the script: + +```bash +python Email_slicer.py +``` + +### Enter an email address when prompted. + +### The script will output the extracted username and domain. + +## Example + +```bash +Enter an email address: example_user@example.com +Username: example_user +Domain: example.com +``` \ No newline at end of file