Homework

Email validator

Create a function that validates an email address.

def isValidEmail(email):
    return False

An email is considered valid if:

  • It has exactly one @ symbol

  • It has at least one .

  • There is at least one . following the @ symbol

  • There is at least one character before the @

  • There is at least one character between the @ and .

  • There is at least one character after the final .

Hints:

  • Splitting the string might help (more than once)

  • Splitting the string might not be the only thing to do

  • Break down the problem in order of simplest thing to check.

Test your code to see if it gets the correct output

Last updated

Was this helpful?