input: 
  def linear_search(arr, x):
      """ Optimize the following python code using best practices
      >>> linear_search([3, 5, 7, 9], 5)
      1
      >>> linear_search([1, 2, 3, 4], 6)
      -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