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 two parameters: a list of email addresses and a domain string. If the 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", "david@yahoo.com"], "@yahoo.com")==["david@yahoo.com"]
  assert filter_emails(["alex@outlook.com", "emma@outlook.com"], "@yahoo.com")==[]
  assert filter_emails([], "@gmail.com")==[]
output: def filter_emails(emails, domain):
      return [email for email in emails if email.endswith(domain)]