input: 
  def rewrite_code(code: str) -> str:
      """
      Given a piece of code in one programming language, rewrite it in another programming language.
  
      >>> rewrite_code('''
      let arr = [1, 2, 3, 4, 5];
  
      arr.forEach(item => {
       console.log(item * 2);
      });
      ''')
      '''
      arr = [1, 2, 3, 4, 5]
  
      for item in arr:
       print(item * 2)
      '''
      """
  
output:     lines = code.strip().split('\n')
      result = []
      for line in lines:
          if 'let arr' in line:
              result.append('arr = ' + line.split('=')[1].strip().rstrip(';'))
          elif 'arr.forEach' in line:
              result.append('for item in arr:')
          elif 'console.log' in line:
              result.append('    print(' + line.split('(')[1].rstrip(');'))
      return '\n'.join(result)