Write a useful prompt
Name the function, describe its inputs and output, and include important edge cases. If performance or Python version matters, state that too.
Clear input
“Write a Python 3 function that accepts a list of integers, returns the sum of even values, and returns 0 for an empty list.”
Vague input
“Make a Python function for numbers.”
Review the generated Python
- Confirm parameter and return types match your caller.
- Test empty, invalid, and unusually large inputs.
- Check whether imported packages are available and appropriate.
- Review file, network, database, and subprocess operations carefully.
- Run formatting, type checks, and unit tests in your own project.