input: Write a function to filter a list of email addresses to only include those that belong to a specific domain. The function takes two arguments: the list of email addresses and the domain to filter by. It returns a filtered list of email addresses.
  
  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@outlook.com", "eve@hotmail.com"], "@hotmail.com") == ["alice@hotmail.com", "eve@hotmail.com"]
  assert filter_emails([], "@gmail.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"], "@microsoft.com") == ["bob@microsoft.com"]
output: def filter_emails(emails, domain):
      return [email for email in emails if email.endswith(domain)]