input: Write a function to filter email addresses based on a specified domain. If the given list is empty, return an empty list.
  assert filter_emails(["john@gmail.com", "sarah@yahoo.com", "bob@microsoft.com", "sophie@gmail.com"], "@gmail.com")==["john@gmail.com", "sophie@gmail.com"]
  assert filter_emails(["alice@hotmail.com", "mark@hotmail.com"], "@hotmail.com")==["alice@hotmail.com", "mark@hotmail.com"]
  assert filter_emails(["john@gmail.com", "sarah@yahoo.com"], "@yahoo.com")==["sarah@yahoo.com"]
  assert filter_emails(["john@gmail.com", "sarah@yahoo.com"], "@outlook.com")==[]
  assert filter_emails([], "@gmail.com")==[]
output: def filter_emails(emails, domain):
      return [email for email in emails if email.endswith(domain)]