input: Write a function to filter a list of email addresses and return a list of email addresses that belong to a specific domain. The function should take in a list of email addresses and a domain string as input, and return a filtered list. 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(["jane@gmail.com", "alex@hotmail.com", "lisa@yahoo.com"],"@hotmail.com")==["alex@hotmail.com"]
  assert filter_emails(["david@gmail.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)]