input: Write a function to filter a list of email addresses such that only those belonging to a specified domain are included. The function should take two arguments: the list of email addresses and the domain to filter by. If the given list of email addresses 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", "jim@yahoo.com", "sam@outlook.com"], "@yahoo.com")==["jim@yahoo.com"]
  assert filter_emails(["john@gmail.com", "jane@gmail.com"], "@outlook.com")==[]
  assert filter_emails([], "@gmail.com")==[]
output: def filter_emails(emails, domain):
      return [email for email in emails if email.endswith(domain)]