input: Write a function to filter out email addresses belonging to a specific domain from a given list. The function should take a list of email addresses and a domain name as input, and return a filtered list containing only the emails from that domain.
  
  
  def filter_emails_by_domain(emails, domain):
      return [email for email in emails if email.endswith(domain)]
  
  # Test cases
  print(filter_emails_by_domain(["john@gmail.com", "sarah@yahoo.com", "bob@microsoft.com", "sophie@gmail.com"], "@gmail.com"))
  # Expected output: ["john@gmail.com", "sophie@gmail.com"]
  
  print(filter_emails_by_domain(["alice@hotmail.com", "dan@hotmail.com", "eva@yahoo.com"], "@hotmail.com"))
  # Expected output: ["alice@hotmail.com", "dan@hotmail.com"]
  
output: def filter_emails_by_domain(emails, domain):
      return [email for email in emails if email.endswith(domain)]