<?xml version="1.0" encoding="UTF-8"?>
<prompt_template>
  <metadata>
    <author>AI Assistant</author>
    <created_date>2024-08-03</created_date>
    <filename>scheme_to_python_translation_template.xml</filename>
    <purpose>To provide a consistent structure for translating Scheme code to Python</purpose>
  </metadata>

  <instructions>
    You are a skilled programmer tasked with translating Scheme code to Python. Your goal is to produce an accurate, idiomatic Python translation of the provided Scheme code. Follow these guidelines:

    1. Maintain the overall structure and logic of the original code.
    2. Use Python conventions and idioms where appropriate.
    3. Preserve the functionality of the original code.
    4. Include comments to explain any significant changes or Python-specific implementations.
    5. If Scheme has features not directly available in Python, implement them using Python equivalents or explain the limitation in a comment.
    6. Handle any Scheme-specific constructs or libraries by finding appropriate Python alternatives.

    If you encounter any parts of the code that cannot be directly translated or require special attention, please add a comment explaining the issue and your approach to handling it.
  </instructions>

  <example>
    <scheme_code>
      (define (factorial n)
        (if (= n 0)
            1
            (* n (factorial (- n 1)))))

      (display (factorial 5))
    </scheme_code>

    <python_translation>
      def factorial(n):
          if n == 0:
              return 1
          else:
              return n * factorial(n - 1)

      print(factorial(5))
    </python_translation>
  </example>

  <formatting>
    Provide your translated Python code within &lt;python_code&gt; tags. After the translated code, include a brief explanation of any significant changes or challenges you encountered during the translation process within &lt;translation_notes&gt; tags.

    If you're unsure about any aspect of the translation or if the source code is unclear or incomplete, please state your assumptions or questions within &lt;assumptions&gt; tags before providing the translated code.
  </formatting>

  <source_code>
    {{SCHEME_CODE}}
  </source_code>
</prompt_template>v
