Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1Write a Python function that takes a list of marks | AToo vague: it does not state the language, the inputs, the expected output or any constraints. | |
| 2Do not use any external libraries. | BUpdate: also return 0 if the list is empty. | |
| 3Give an example input and output so the AI can see exactly what is expected | CExample: input [70, 80, 90] should return 80.0 | |
| 4Refine the prompt when the first result is not right by adding the missing requirement | DIt leaves out the input and an example, so the AI does not know what data is given or what the result should look like. | |
| 5Make me a program for my marks. | EA constraint that limits how the generator may write the code | |
| 6Write a Python function to find the average. Return it. | FStates the language (Python) and the input (a list of marks) so the generator knows what to produce |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
prompt — Instructions given to an AI code generator. A good one states the language, the inputs, the expected output and any constraints so the code matches the requirements.Language: Python
Input: a list of student marks
Output: the average markLanguage: Python
Input: a list of student marks
Output: the average markLanguage: Python
Task: square a number
Example: input 3 gives output 9Language: Python
Task: find the highest mark in a list
Constraint: do not use the max() functionCode missed my rules, so I will
refine the prompt and add an example.