top of page
learn_data_science.jpg

Data Scientist Program

 

Free Online Data Science Training for Complete Beginners.
 


No prior coding knowledge required!

Email Splitter for Separating Username from Domain Name

Writer: mrbenjaminowusumrbenjaminowusu

This is a simple app to separate the username and domain name in an email. This app requires the user to enter an email of their choosing.


First we allow the user to input their email by calling the input function as a string and assigning the output to the letter "a".

a=input("PLEASE ENTER YOUR EMAIL: " )

Then using the if statement. if the character "@" is in the variable "a". We call the split method on the string "a" and index the first character and store it in the variable user_name. We do the same for the variable domain_name while indexing the second character. Finally we print the separated output if the statement. Else we print "email is not valid".

if '@' in a:
    user_name= a.split('@')[0]
    dormain_name= a.split('@')[1]
else:
    print("your email is not valid.")

When the code is run it displays this output below

PLEASE ENTER YOUR EMAIL: donbolingo@outlook.com
your username is: donbolingo and your domain name is: outlook.com
 
 

Comments


COURSES, PROGRAMS & CERTIFICATIONS

 

Advanced Business Analytics Specialization

Applied Data Science with Python (University of Michigan)

Data Analyst Professional Certificate (IBM)

Data Science Professional Certificate (IBM)

Data Science Specialization (John Hopkins University)

Data Science with Python Certification Training 

Data Scientist Career Path

Data Scientist Nano Degree Program

Data Scientist Program

Deep Learning Specialization

Machine Learning Course (Andrew Ng @ Stanford)

Machine Learning, Data Science and Deep Learning

Machine Learning Specialization (University of Washington)

Master Python for Data Science

Mathematics for Machine Learning (Imperial College London)

Programming with Python

Python for Everybody Specialization (University of Michigan)

Python Machine Learning Certification Training

Reinforcement Learning Specialization (University of Alberta)

Join our mailing list

Data Insight participates in affiliate programs and may sometimes get a commission through purchases made through our links without any additional cost to our visitors.

bottom of page