input: def linear_search(arr, x):
      """ Find the index of the first occurrence of x in arr using a linear search.
          If x is not found, return -1.
      >>> linear_search([1, 2, 3, 4], 3)
      2
      >>> linear_search([1, 2, 3, 4], 5)
      -1
      """
output:     for i in range(len(arr)):
          if arr[i] == x:
              return i
      return -1