input: Write a function to filter a list of email addresses to include only those that belong to a specified domain. The function should take a list of email addresses and a string representing the domain (including the "@") as input, and return a list of filtered email addresses.
  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", "edward@outlook.com"], "@outlook.com")==["edward@outlook.com"]
  assert filter_emails(["jim@yahoo.com", "lucy@yahoo.com"], "@yahoo.com")==["jim@yahoo.com", "lucy@yahoo.com"]
  assert filter_emails([], "@gmail.com")==[]
  assert filter_emails(["anne@msn.com", "greg@msn.com"], "@msn.com")==["anne@msn.com", "greg@msn.com"]
output: def filter_emails(emails, domain):
      return [email for email in emails if email.endswith(domain)]