input: Write a function to filter a list of email addresses to include only those belonging to a specified domain. The function should take two parameters: the list of email addresses and the domain to filter by. It should return a new list containing only the email addresses that match the specified domain.
  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@yahoo.com", "mark@outlook.com", "linda@yahoo.com"], "@yahoo.com")==["jane@yahoo.com", "linda@yahoo.com"]
  assert filter_emails(["alex@hotmail.com", "chris@icloud.com"], "@gmail.com")==[]
  assert filter_emails([], "@gmail.com")==[]
output: def filter_emails(emails, domain):
      return [email for email in emails if email.endswith(domain)]