input: def linear_search(arr, x):
      """
      Perform a linear search on the input array 'arr' to find the element 'x'.
      Returns the index of the first occurrence of 'x' in the array. If 'x' is not found, returns -1.
      >>> linear_search([1, 2, 3, 4, 5], 3)
      2
      >>> linear_search([10, 20, 30], 40)
      -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