input: Write a function to perform a linear search and return the index of the element if found, otherwise return -1.
  assert linear_search([2, 3, 4, 10, 40], 10) == 3
  assert linear_search([2, 3, 4, 10, 40], 5) == -1
  assert linear_search([1, 2, 3, 4, 5], 1) == 0
  assert linear_search([], 3) == -1
output: def linear_search(arr, x):
      for i in range(len(arr)):
          if arr[i] == x:
              return i
      return -1