From 9978b5d44c7ac46162d74db7733f1ef5cb00ed87 Mon Sep 17 00:00:00 2001 From: adnannextdoor Date: Wed, 20 Nov 2024 14:46:30 +0000 Subject: [PATCH] Add more specific domain slicing --- Email Slicer/EmailSlicer.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Email Slicer/EmailSlicer.py b/Email Slicer/EmailSlicer.py index 54171bcf..cf8b2175 100644 --- a/Email Slicer/EmailSlicer.py +++ b/Email Slicer/EmailSlicer.py @@ -14,8 +14,12 @@ def isValidEmail(email): if isValidEmail(email): username = email[0:email.index('@')] - domain = email[email.index('@')+1: ] + SLdomain = email[email.index('@')+1:email.index('.')] + Tldomain = email[email.index('.'):] + + print("Username - ", username) - print("Domain - ", domain) + print("Domain: Second-Level - ", SLdomain) + print("Domain: Top-Level - ", Tldomain) else: print("Invalid Email!") \ No newline at end of file