input: def linear_search(arr, x):
      """ Optimize the original linear search function by using Python best practices.
      >>> linear_search([1, 2, 5, 3, 7], 3)
      3
      >>> linear_search([1, 2, 5, 3, 7], 9)
      -1
      """
      for index, item in enumerate(arr):
          if item == x:
              return index
      return -1
output:     for index, item in enumerate(arr):
          if item == x:
              return index
      return -1