42330/how-to-get-domain-name-of-email-id
I am writing a script that will check the domain name and print the name of the domain. For example if the email id is abc@gmail.com, then the output should be Gmail and so on. How can I implement this?
You can use the split method to split the string into two parts (before and after '@') and then compare it.
Hey, refer to the below code to do this:
email=’abc@gmail.com’ eid=email.split(‘@’) if eid[1]==’gmail.com’: print “Gmail”
Hello kartik, The variation of the context processor ...READ MORE
Use the following query statement and let ...READ MORE
If you are talking about the length ...READ MORE
Using SQLAlchemy, I can query a bunch ...READ MORE
You can also use the random library's ...READ MORE
Syntax : list. count(value) Code: colors = ['red', 'green', ...READ MORE
Enumerate() method adds a counter to an ...READ MORE
You can simply the built-in function in ...READ MORE
Check out the documentation, Document.objects is a QuerySet object. You seem to be ...READ MORE
You can specify the class you want ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.