input: Write a function to implement a linear search algorithm in Python. The function should take an array and a value to search for, and return the index of the value if it is found, or -1 if it is not.
  
  assert linearSearch([5, 3, 7, 2], 7) == 2
  assert linearSearch([5, 3, 7, 2], 1) == -1
  assert linearSearch([], 4) == -1
  assert linearSearch([1, 1, 1, 1], 1) == 0
  assert linearSearch([8, 7, 6, 5, 4], 4) == 4
  
output: def linearSearch(arr, value):
      for i in range(len(arr)):
          if arr[i] == value:
              return i
      return -1