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