input: Write a python function to search for an element in a list by its index.
  assert search([1, 2, 3, 4, 5], 2) == 3
  assert search([10, 20, 30, 40, 50], 4) == 50
  assert search(['a', 'b', 'c', 'd'], 0) == 'a'
  assert search([1, 2, 3, 4, 5], 5) == None
  assert search([10, 20, 30, 40, 50], -1) == None
output: def search(lst, index):
      if 0 <= index < len(lst):
          return lst[index]
      return None