input: from typing import List
  
  def count_x(y: List[int], x: int) -> int:
      """
      Count the number of occurrences of an element x in a list y.
      >>> count_x([3, 5, 2, 7, 4, 3, 2], 2)
      2
      >>> count_x([1, 1, 1, 2, 3, 4, 1], 1)
      4
      """
output:     count = 0
      for num in y:
          if num == x:
              count += 1
      return count