UrbanPro
true

Learn Python Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Learn Python : Slicing out an email address

B
Biswanath Banerjee
12/04/2018 0 0

We take a small task of slicing out the username and domain name from an email address. We ask the user to type his email address. We take his email address and slice out first his username and then the domain name of the user. Then we display his username and the domain name after formatting the message.This small program can be written in Python very easily. Lets python this task below:

#get user email address
email = input("what is your email address? ").strip()

#slice out username
user =email[:email.index("@")]

#slice out the domain name
domain = email[email.index("@")+1:]

#format message
output = "Your username is {}and your domain name is {}".format(user,domain)

#display output message
print(output)

0 Dislike
Follow 2

Please Enter a comment

Submit

Other Lessons for You

Why is the Hadoop essential?
Capacity to store and process large measures of any information, rapidly. With information volumes and assortments always expanding, particularly from web-based life and the Internet of Things (IoT), that...

Debugging Python code
If you are getting an error while executing your python code, the better way of running your python code is by using -i switch. ex: python -i scriptname.py once you run the above command, your execution...

Black in Python
When you are upturn in your career from beginner to experienced in programming world, your team will start looking at ‘how you are writing?’ Here the responsibility piling up. Okay,...

Benefits of Design Patterns in Application Development
Application developments is a tedious job. Programmers write code and test it again and again to make sure their software works fine. So designing complex software is a hard nut to crack. Skilled programmers...

Personalise touch of training & learning
We all are in countinous learning phase in life. Day to day we are learning new things,new language words,new faces,new gazets by all means of modes like reading books,newspapers,watching TV,movies,meeting...
S

Smartnub Softsolutions

0 0
0
X

Looking for Python Training Classes?

The best tutors for Python Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Python Training with the Best Tutors

The best Tutors for Python Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more