Year 10 can already write short Python functions; this lesson is about how far to trust code an AI assistant writes. The teacher gives a one-line brief, "write a function that checks whether a password is strong", and the rule the class must meet: at least twelve characters, with a capital letter, a number and a symbol. Students first write eight test cases from the rule without any help, including an empty string, eleven characters that meet every other condition and a long password with no symbol. They then ask Microsoft 365 Copilot Chat, on school-approved accounts with no real passwords or personal information in any prompt, for a function from the one-line brief alone, run its code in Replit against their tests and record which cases fail and which rule the assistant assumed instead. Next they add the class rule to the prompt, test the new version and compare the two, and the lesson ends with the pooled failures on the board and a short written critique from each student of what the assistant assumed and which prompt change fixed it.
Tools: Microsoft 365 Copilot Chat, Replit Nine ideas for your own version in Generate
This page is one of a growing set of PICRAT examples by cell, subject and grade. Page maintained by Andy Perryer.