Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

write a simple python script for an email checker

please provide an explanation of how it functions 

I've attached the example I'm trying to achieve 

  1. Write a program that asks user to enter email address. Program then checks and prints whether email entered by the user is valid. Structure your program to have two functions: 
  1. isEmailValid function that takes a string as parameter and returns True or False depending on whether the input string matches all the requirements of a valid email listed
  2. main function that repeatedly
    1. prompts the user for the email address,
    2. calls isEmailValid method passing the user entered string, saves the returned value
    3. reports whether the email is valid or not depending on the returned value.
    4. asks user if he/she wants to continue. If so, repeats above steps. Otherwise ends the program.
  3. Use the recommended strategy of calling the main function use "if __name__ ..." format.

 

 

Email should be of the form first.last@bellevuecollege.edu. It should have

    • a '.'
    • a '@'
    • should end with "bellevuecollege.edu"
    • index of first '.' should be less than the index of '@'
    • there should be only one '.' before '@'
    • it should contain non-empty first and last names

 

Hints:

  • Use find / in / endswith methods
  • Remember that isEmailValid method returns a boolean value of True or False.
  • If any one of the requirements is not met, it should return False. And should return True only if all the requirements are met. 
  • Clearly you will need to have many if conditions. Sequence them correctly.
*Python 3.6.3 Shell*
File Edit Shell Debug Options Window Help
>>>
====== RESTART: C:/code/Python/Playground/strings/email.py
==
Enter the email address: t.h@bellevuecollege.edu
Valid email
Want to continue (y/n) ? y
Enter the email address: t.h
Invalid email
Want to continue (y/n) ? y
Enter the email address: tebellevuecollege.edu
Invalid email
Want to continue (y/n) ? y
Enter the email address: t.h@belle.edu
Invalid email
Ln: 75 Col: 4
expand button
Transcribed Image Text:*Python 3.6.3 Shell* File Edit Shell Debug Options Window Help >>> ====== RESTART: C:/code/Python/Playground/strings/email.py == Enter the email address: t.h@bellevuecollege.edu Valid email Want to continue (y/n) ? y Enter the email address: t.h Invalid email Want to continue (y/n) ? y Enter the email address: tebellevuecollege.edu Invalid email Want to continue (y/n) ? y Enter the email address: t.h@belle.edu Invalid email Ln: 75 Col: 4
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education