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