Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Resit-project-/email list.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
28 lines (24 sloc)
969 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def List_maker(): | |
import re | |
email_list = [] | |
regex= "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$" | |
print("welcome to the email subscriber list") | |
Key = "Y" | |
while(Key == "Y"): | |
email= input("\nEnter the email address you would like to add to the list.: ") | |
if(re.search(regex,email)): | |
email_list.append(email) | |
print("\n CURRENT EMAIL LIST : {} ".format(email_list)) | |
print("\nDo you want to enter another email address?") | |
print("\nEnter: 1 for Yes, 2 for No") | |
yesorno= int(input()) | |
if (yesorno==1): | |
Key = "Y" | |
elif (yesorno ==2): | |
Key= "N" | |
print("\n FINAL EMAIL LIST: {} ".format(email_list)) | |
else: | |
print("\nWrong input!!") | |
else: | |
print("\nPlease enter a Valid Email address!") | |
List_maker() | |