input: Write a function to modify the given Python code to make it more efficient. The function should return the updated code as a string.
  assert efficient_code('[1, 2, 3, 4]')=='data = [1, 2, 3, 4]\nresult = [x for x in data if x > 2]'
  assert efficient_code('[5, 6, 7, 8]')=='data = [5, 6, 7, 8]\nresult = [x for x in data if x > 2]'
  assert efficient_code('[1, 2, 2, 1]')=='data = [1, 2, 2, 1]\nresult = [x for x in data if x > 2]'
  assert efficient_code('[]')=='data = []\nresult = []'
  assert efficient_code('[2]')=='data = [2]\nresult = []'
output: def efficient_code(code):
      data = eval(code)
      result = [x for x in data if x > 2]
      return f'data = {data}\nresult = {result}'