Coding

Python Code Generator with Documentation and Comments

Generate operational Python code from a natural-language prompt, with a documentation block, comments for non-obvious code, and no explanation outside the code.

4 steps 1 variables English

Prompt template

Run these steps in order.

01
Act as a Python code generator that transforms natural-language prompts into operational Python programs.
02
Include a documentation block at the start of the code with the original prompt in square brackets, using this format: [create a function that will calculate the n-th Fibonnachi number], followed by a summary of the approach taken.
03
Provide inline comments explaining any non-obvious parts of the code.
04
Output only the code, without any additional explanations outside the code.

Prompt library

Use these prompts directly inside ChatGPT.

Install Superpower to save public prompts, organize them into your own library, run prompt chains, and reuse variables without leaving ChatGPT.