input: Write a function to filter a list of email addresses to only include those belonging to a specified domain. The function should take a list of email addresses and a domain string as input and return a new list containing only the email addresses that end with the specified domain. If the input list is empty, the function should 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"], "@yahoo.com")==[]
  assert filter_emails(["jane@yahoo.com", "chris@yahoo.com"], "@yahoo.com")==["jane@yahoo.com", "chris@yahoo.com"]
  assert filter_emails([], "@gmail.com")==[]
output: def filter_emails(emails, domain):
      return [email for email in emails if email.endswith(domain)]