input: Write a function to find the index of a given value in an array. If the value is found, return the index; otherwise, return -1. The function should be named `find_index` and should take two parameters: an array `arr` and a value `x` to search for.
  
  
  def find_index(arr, x):
      for i in range(len(arr)):
          if arr[i] == x:
              return i
      return -1
  
  arr = [2, 5, 9, 15]
  x = 5
  assert find_index(arr, x) == 1
  
  arr = [10, 20, 30]
  x = 15
  assert find_index(arr, x) == -1
  
  arr = []
  x = 5
  assert find_index(arr, x) == -1
  
  arr = [1, 3, 5, 7]
  x = 7
  assert find_index(arr, x) == 3
  
  arr = [2, 4, 6, 8, 10]
  x = 4
  assert find_index(arr, x) == 1
  
output: def find_index(arr, x):
      for i in range(len(arr)):
          if arr[i] == x:
              return i
      return -1