Skip to content

Email_slicer created #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Email_slicer/Email_slicer.py
Original file line number Diff line number Diff line change
@@ -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()
22 changes: 22 additions & 0 deletions Email_slicer/Read.md
Original file line number Diff line number Diff line change
@@ -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: [email protected]
Username: example_user
Domain: example.com
```