input: Write a function to rewrite the given JavaScript code in Python. The JavaScript code iterates through an array, doubles each element, and prints the result. The function should produce a Python equivalent.
  assert rewrite_js_to_python(["// JavaScript code\nlet arr = [1, 2, 3, 4, 5];\narr.forEach(item => {console.log(item * 2);});"])==["# Python code\narr = [1, 2, 3, 4, 5]\n\nfor item in arr:\n print(item * 2)"]
  assert rewrite_js_to_python(["// JavaScript code\nlet arr = [2, 4, 6];\narr.forEach(item => {console.log(item + 1);});"])==["# Python code\narr = [2, 4, 6]\n\nfor item in arr:\n print(item + 1)"]
  assert rewrite_js_to_python(["// JavaScript code\nlet arr = [10];\narr.forEach(item => {console.log(item / 2);});"])==["# Python code\narr = [10]\n\nfor item in arr:\n print(item / 2)"]
  assert rewrite_js_to_python(["// JavaScript code\nlet arr = [];\narr.forEach(item => {console.log(item);});"])==["# Python code\narr = []\n\nfor item in arr:\n print(item)"]
  assert rewrite_js_to_python([""])==[""]
output: 
  def rewrite_js_to_python(js_code):
      if not js_code or not js_code[0]:
          return [""]
      js_lines = js_code[0].split("\n")
      arr_line = js_lines[1]
      operation_line = js_lines[2]
      arr_value = arr_line.split("=")[1].strip().strip(";")
      operation = operation_line.split("=> {console.log(")[1].split(");}")[0]
      python_code = f"arr = {arr_value}\n\nfor item in arr:\n print({operation})"
      return [f"# Python code\n{python_code}"]
  