input: Write a function to filter a list of email addresses and return only those that belong to a specified domain. The function should take a list of email addresses and a domain string as input, and return a filtered list of email addresses that end with the specified domain. If no emails match the domain, the function should return an empty list.
  assert filter_emails(["john@gmail.com", "sarah@yahoo.com", "bob@microsoft.com", "sophie@gmail.com"], "@hotmail.com") == []
  assert filter_emails(["john@gmail.com", "sarah@yahoo.com", "bob@microsoft.com", "sophie@gmail.com"], "@yahoo.com") == ["sarah@yahoo.com"]
  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([], "@gmail.com") == []
output: def filter_emails(emails, domain):
      return [email for email in emails if email.endswith(domain)]