input: Write a function to implement a linear search algorithm in Python. The function should take in 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.
  def linearSearch(arr, value):
    for i in range(len(arr)):
      if arr[i] == value:
        return i  # value found, return index
    return -1  # value not found
  assert linearSearch([5, 3, 7, 2], 7) == 2  # Value 7 is found at index 2
  assert linearSearch([5, 3, 7, 2], 4) == -1  # Value 4 is not found in the array
  assert linearSearch([], 3) == -1  # Empty array, value 3 is not found
  assert linearSearch([1, 2, 3, 4, 5], 1) == 0  # Value 1 is found at index 0
  assert linearSearch([10, 20, 30], 30) == 2  # Value 30 is found at index 2
output: 
  def linearSearch(arr, value):
    for i in range(len(arr)):
      if arr[i] == value:
        return i  # value found, return index
    return -1  # value not found
  