Question: 3. A sample email address is shaik.acb@mail.com.au. You must create a function called isGoodEmail() that takes a string parameter representing a user's email and returns

3. A sample email address is "shaik.acb@mail.com.au". You must create a function called isGoodEmail() that takes a string parameter representing a user's email and returns true when the email complies with a set of requirements and false when it doesn't. You must include a Docstring comment in your function.

Perhaps you won't have enough time to test and fix your code. Even if your code doesn't execute, your marker will review it and provide you marks for what you get right.

The email address must follow the following guidelines: The email address can only contain one "@" character, which splits the address into two strings known as firstPart and secondPart. Neither the firstPart nor the secondPart is empty string.

The firstPart and secondPart can only contain letters, numbers, underscores, and full stops.

Both the firstPart and secondPart do not start or end with a full stop.

Both the firstPart and secondPart do not contain any substrings of two consecutive full stops ("..").

Please note that the above rules may or may not be realistic. They have been contrived specifically for this question. Please complete the following function. It takes a single string argument and return a boolean value of true if the argument is valid and return false otherwise: isLetDigUndStop() # Does the argument consist of only letters, # digits underscores and full stops, e.g. # aa = isLetDigUndStop("$37"); # The variable aa will get the value false. Normally Python code would validate such requirements using a regular expression, but here you are required to perform the validation using iterations, conditionals, and string handling.

Zero marks will be awarded for a solution using other mechanisms.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!