0 out of 68 challenges solved

Validate an email addresses

Question:
Write a function called validate_email_address that takes a string as input and returns True if the input string is a valid email address, and False otherwise. A valid email address must satisfy the following criteria:

  • Starts with one or more alphanumeric characters
  • Contains an @ symbol
  • Followed by one or more alphanumeric characters
  • Followed by a period (.)
  • Ends with two or more alphabetical characters

Use regular expressions (regex) to validate the email address.

Example:
Input: "info@example.com"
Output: True

import re

def validate_email_address(email):
    """
    Validates an email address based on certain criteria using regex.

    Args:
    email (str): The input email address.

    Returns:
    bool: True if the email address is valid, False otherwise.
    """
    # TODO: Implement the validate_email_address function
    pass