my assignment is to design a structure that will interrogate a string of characters to see if the email is valid or invalid.In Python, there are multiple ways to complete almost any task. Performing a...

1 answer below »
my assignment is to design a structure that will interrogate a string of characters to see if the email is valid or invalid.In Python, there are multiple ways to complete almost any task. Performing a simple Google search will reveal many interesting and elegant solutions using a variety of techniques. In this lesson we are working with string manipulation.Thus, the solution must be obtained using string manipulation. (this is a special note from my instructor.)
Answered Same DayJun 05, 2021

Answer To: my assignment is to design a structure that will interrogate a string of characters to see if the...

Rushendra answered on Jun 06 2021
139 Votes
email-validate/validate.py
import re;
def validate(email):
count=email.count('@')
countd
ot=email.count('.')
if(count>1):
print("too many @")
return;
if(email[0]=='@'):
print("@ not valid in position1")
return
if(count<1):
print("@ missing")
return;
arr=email.split("@");
if(len(arr[1])<5):
print("not valid in last 5 positions")
return
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here