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 checks if a number is prime | Aresult = ai_draft(); run_tests(result) | |
| 2def total_price(items): # editor suggests next line | BThe description is too vague. A generator needs a clear, detailed plain-language request to give useful code. | |
| 3An AI code generator can save time by writing a first draft of code, but a person must still test it | CA chat-based generator turns a plain-language request like this into program code | |
| 4An AI code generator cannot be trusted to know your exact needs, so you must give a clear description | DUsing AI code without checking it. A person must still read, test and fix the generated code. | |
| 5# AI wrote this, so it must be correct use_code(ai_output) | Eprompt = "Write a function that adds GST to a price" | |
| 6prompt = "Make my game" | FCode completion in an editor suggests the next lines as you type |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
AI code generator — A tool that writes program code from a plain-language description or by suggesting the next lines as you type. It can save time, but a person must still check the code.# AI suggestion: add two numbers
def total(a, b):
return a + b# Prompt: show every item in a list
for item in items:
print(item)# Test the AI code before using it
result = total(2, 3)
assert result == 5# AI suggestion: check for an adult
if age >= 18:
print("Adult")# AI suggestion: count from 1 to 5
for i in range(1, 6):
print(i)