input: Write a function to optimize the given Python code using list comprehension. The function should take a list as input and return a new list containing only the elements that are greater than 2. If the input list is empty, the function should return an empty list.
  assert optimize_code([1, 2, 3, 4])==[3, 4]
  assert optimize_code([2, 4, 6, 8])==[4, 6, 8]
  assert optimize_code([1, 2])==[]
  assert optimize_code([])==[]
  assert optimize_code([3, 5, 7])==[3, 5, 7]
output: def optimize_code(lst):
      return [x for x in lst if x > 2]