arr = [100, 200, 300, 400, 500] x = 400 def search(arr, x): for i in range(len(arr)): if arr[i] == x: return i return -1 print(search(arr, x))