<prompt> Write a function to validate an email address.  <response>: Here is an example of a function in Python that can be used to validate an email address:pythonimport redef validate_emailemail: pattern if re.matchpattern, email: return True else: return FalseThis function uses a regular expression pattern to match the input email against a set of rules that define a valid email address. These rules include the presence of an symbol, domain components separated by periods, and a top-level domain component of at least two characters.To use this function, you would need to pass the email address you want to validate as an argument. For example:pythonemail if validate_emailemail: printemail, is a valid email addresselse: printemail, is not a valid email addressThis would output: is a valid email address 