input: Write a function to convert the given JavaScript code snippet into Python. The JavaScript code iterates through an array, multiplies each element by 2, and prints the result. If the given code is successfully converted, it should produce the same output as the original JavaScript code.
  def convert_javascript_to_python(code):
      # Implement the conversion logic here
      pass
  
  assert convert_javascript_to_python("let arr = [1, 2, 3, 4, 5];\narr.forEach(item => { console.log(item * 2); });") == "arr = [1, 2, 3, 4, 5]\nfor item in arr:\n    print(item * 2)"
  assert convert_javascript_to_python("let arr = [10, 20, 30];\narr.forEach(item => { console.log(item * 3); });") == "arr = [10, 20, 30]\nfor item in arr:\n    print(item * 3)"
  assert convert_javascript_to_python("let arr = [];\narr.forEach(item => { console.log(item * 1); });") == "arr = []\nfor item in arr:\n    print(item * 1)"
  assert convert_javascript_to_python("") == ""
  assert convert_javascript_to_python("let arr = [7];\narr.forEach(item => { console.log(item * 10); });") == "arr = [7]\nfor item in arr:\n    print(item * 10)"
output: def convert_javascript_to_python(code):
      if not code:
          return ""
      arr_start = code.find("let arr = ") + len("let arr = ")
      arr_end = code.find(";", arr_start)
      arr_str = code[arr_start:arr_end]
      arr_str = arr_str.replace("[", "").replace("]", "")
      arr_list = arr_str.split(", ") if arr_str else []
      multiply_start = code.find("item * ") + len("item * ")
      multiply_end = code.find(")", multiply_start)
      multiply_factor = code[multiply_start:multiply_end]
      result = f"arr = {arr_list}\nfor item in arr:\n    print(item * {multiply_factor})"
      return result