A prompt is the input given to an AI code generator to describe the code you want. A useful prompt states the task, identifies the data and names any requirements that matter. Generated code can save time, but it still needs to be read, run and checked. section 2.5 section 5.9.2
Before entering a prompt:
- Work out what the program must do. Solving the problem yourself first can make the request more precise and the result easier to evaluate. section 5.9.1
- Include the required operations, inputs and outputs, but omit work already done. If a list of temperatures has been loaded, ask for the calculations rather than another file reader. section 5.9.3
- Specify constraints that could change the solution. For a word-counting task, ask for a dictionary if using a dictionary matters; otherwise the generator may use Counter. section 7.8.1
- When changing existing code, make that code available and describe the intended change. A request to restructure processing into functions needs the working code and that structural goal. section 9.9.1
Ask for exactly the missing work
Suppose Python has already read temperatures into a list. Ask: “Using the list temperatures, find the high, low, mean, and median temperatures, and show how many unique temperatures are in the list.” The request names the available input and every desired result without repeating the file-loading step. section 5.9.3
Using the list temperatures, find the high, low, mean, and median temperatures, and show how many unique temperatures are in the list.
The complete temperature prompt is short enough to inspect against its required outputs. section 5.9.3
The amount of detail depends on the task. A text-cleaning request can name the source and output files and spell out lowercase conversion, punctuation removal and word splitting. A command-line refactoring request can specify the behavior to imitate, the supported options and the expected form of the output. In either case, provide the generator with any existing code it must change. section 6.10.1 section 11.5.1
Treat the generated program as a candidate solution, not a verified answer. In one weather-file task, a generator checked whether 'Cook' was an entire field in a row rather than checking the county field; the resulting CSV contained only its header. Run the code, inspect its output and refine the request or fix the code when it misses the requirement. section 21.6.2 section 5.9.2

















































