How to use the Code Explainer.
Explain code at the level needed for the task. Include inputs, output and assumptions, and distinguish intended behavior from behavior actually shown.
Make the workflow fit your task.
Identify inputs, outputs and the sequence of operations, then explain the code at the level needed for the reader's question. Separate demonstrated behavior from intended purpose and include a small trace where it clarifies the result.
- What you provide
- Code snippet and language.
- What you get
- Functionality, control flow and limitations explained.
See the input and the result.
Illustrative input and output · a teaching example, not a live WebAct run
Example input
Explain this Python function and evaluate it for [-2, 0, 3, 1]:
def positives(values):
return [value for value in values if value > 0]Completed example
The comprehension tests each item against zero and builds a new list in input order. positives([-2, 0, 3, 1]) returns [3, 1]. Zero and negative values are excluded. The input list is not modified. Items must support comparison with zero.
Load this input into the prompt, then copy it to WebAct to try the task. Your result may differ from the illustration.
Decisions and troubleshooting.
Should an explanation assume comments describe the code correctly?
Compare comments with actual operations. They may express an outdated intention that the implementation no longer follows.
Why does the explanation ignore a type or boundary case?
Supply representative inputs and the runtime. Behavior can change when values are empty, missing or of a different type.
Try it with your own source.
Replace the example with your material in the task prompt. Keep the requirements you need, then copy the task into WebAct.
Customize and copy the task ↑