input: from typing import List
  
  def search_list(elements: List[str], query: str) -> List[int]:
      """ Finds and returns the indices of all elements in the given list that match the
      search query.
      >>> search_list(["apple", "banana", "peach", "orange", "grape"], "apple")
      [0]
      >>> search_list(["apple", "banana", "peach", "apple", "grape"], "apple")
      [0, 3]
      """
output:     indices = []
      for i, element in enumerate(elements):
          if element == query:
              indices.append(i)
      return indices