input: from typing import List
  
  def linear_search(arr: List[int], x: int) -> int:
      """Searches for the first occurrence of the element x in the list arr using linear search and returns its index.
      If the element x is not found, it returns -1.
      >>> linear_search([3, 5, 6, 7], 6)
      2
      >>> linear_search([3, 5, 6, 7], 8)
      -1
      """
      for index, item in enumerate(arr):
          if item == x:
              return index
      return -1
output:     for index, item in enumerate(arr):
          if item == x:
              return index
      return -1