input: Write a function to translate a JavaScript code snippet to a Python code snippet. The function should take a string representing the JavaScript code as input and return a string representing the equivalent Python code. The JavaScript code will be a simple array iteration where each element is doubled and printed. If the input code is not a valid JavaScript code snippet for the specified operation, return "Invalid input".
  
  function translate_js_to_py(js_code)
  
  assert translate_js_to_py("let arr = [1, 2, 3, 4, 5];\narr.forEach(item => {console.log(item * 2);});") == "# Python code\narr = [1, 2, 3, 4, 5]\nfor item in arr:\n print(item * 2)"
  assert translate_js_to_py("let arr = [6, 7, 8, 9, 10];\narr.forEach(item => {console.log(item * 3);});") == "# Python code\narr = [6, 7, 8, 9, 10]\nfor item in arr:\n print(item * 3)"
  assert translate_js_to_py("let arr = [1];\narr.forEach(item => {console.log(item * 2);});") == "# Python code\narr = [1]\nfor item in arr:\n print(item * 2)"
  assert translate_js_to_py("let arr = [];\narr.forEach(item => {console.log(item * 2);});") == "# Python code\narr = []\nfor item in arr:\n print(item * 2)"
  assert translate_js_to_py("let arr = [1, 2, 3, 4, 5];\narr.forEach(item => {console.log(item);});") == "Invalid input"
output: def translate_js_to_py(js_code):
      if "let arr = " not in js_code or "arr.forEach(item => {console.log(item * " not in js_code or ")});" not in js_code:
          return "Invalid input"
      
      arr_start = js_code.find("let arr = ") + len("let arr = ")
      arr_end = js_code.find(";", arr_start)
      array_str = js_code[arr_start:arr_end].strip()
      
      multiply_start = js_code.find("console.log(item * ") + len("console.log(item * ")
      multiply_end = js_code.find(")", multiply_start)
      multiply_factor = js_code[multiply_start:multiply_end]
      
      python_code = f"# Python code\narr = {array_str}\nfor item in arr:\n print(item * {multiply_factor})"
      return python_code