Beginner Python Projects: Build a Simple Email Slicing Program

Beginner Python Projects: Build a Simple Email Slicing Program

An Email Slicer is just a tool that will take an email id as an input and will perform slicing operations on it to return the username and the domain.

Hello everyone, today we will build an Email Slicer in Python.

What is an Email Slicer?

An Email Slicer is just a tool which will take an email id as an input and will perform slicing operations on it to return the username and the domain of the email id.

For example:

Input:

[email protected]

Output:

Your username is rishabh.singh & domain is gmail.com

Here we returned rishabh.singh as username and gmail.com as a domain.

This project is super simple and quick and it doesn't require any setup so let's quickly jump to coding and build this.

Let's Code

So this first we are going to do is to ask the user to enter the email to be sliced.

email = input("Enter Your Email: ").strip()

Here, as usual, we are making use of the input() function to get the input from the user in the form of string. We will store this input in the email variable.

Also notice that we are making use of a strip() function. strip() function will remove any additional & unwanted spacing on both sides of strings. So that we can make sure that we have only the email in the input and not any unwanted spaces.

python python-programming tutorial python-tutorials

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Python Programming Tutorials For Beginners

Python Programming Tutorials For Beginners

Guide to Python Programming Language

Guide to Python Programming Language

Python Hello World Program - Create & Run Your First Python Program in PyCharm

Python Hello World Program - Your first step towards Python world. Learn how to create the Hello World Python program in PyCharm.

Python Tricks Every Developer Should Know

In this tutorial, you’re going to learn a variety of Python tricks that you can use to write your Python code in a more readable and efficient way like a pro.

How to Remove all Duplicate Files on your Drive via Python

Today you're going to learn how to use Python programming in a way that can ultimately save a lot of space on your drive by removing all the duplicates. We gonna use Python OS remove( ) method to remove the duplicates on our drive. Well, that's simple you just call remove ( ) with a parameter of the name of the file you wanna remove done.