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 the username and domain name.

Writer's picture: mohamed amine brahmimohamed amine brahmi

in this python mini application i will try to check first if the email given by the use contains '@' so it is may be a real email.



email = str(input('could you please give me the email adress ' )) '''input the email from the user as str'''

''' defining a funtion that get the email as input, first of all it will check if the email is real, second it will display the user name and the domaine '''

def email_username(email):

if '@' not in email:

return print('please enter valid email')

else:

username = email.split('@')[0]

domaine = email.split('@')[1]

return print('your username is {a} and your domaine is {b}'.format(a=username,b=domaine))



email = str(input('could you please give me the email adress') 
''' this line is meant to input the email given by the user and transofmed it into string'''
def email_username(email):a
      if '@' not in email:
         return print('please enter valid emil')
         #testing the email by seeing if it contain the '@'
       else:
          username = email.split('@')[0] 
      '''splitting the mail by the delimiter '@' that will return a list, to select the username we have to select the index 0'''
         domaine = email.split('@')[1]
      #the email is the index 1
          return print('your username is {a} and your domaine is {b}'.format(a=username,b=domaine))
      

0 comments

Recent Posts

See All

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