No Error, a Wrong Result
A program that ends with an error at least tells you something is wrong. A program that runs and prints a wrong result tells you nothing: you find out when you check the result. And then there's no error to send.
What the AI needs instead is what you know and it doesn't. It can't run the program, so it knows what the program prints only if it works it out, and it can't know what you wanted it to print. A program that does exactly the wrong thing looks just like one that does the right thing. So say both, with the numbers: what it prints, and what you expected instead. The AI then looks for the line that makes the difference, instead of guessing what you meant.
Mia took the program that finds her longest walk and changed it to find the shortest: longest became shortest, and > became <. It runs without an error. Her shortest walk this week was 20 minutes.
Instructions
- 1
Run the program. Attach
script.py, and write what the program prints and what you expected instead. Ask which line makes the difference, and why. Then send it. - 2
Make the change the answer suggests, keep the list of walks as it is, and run the program. It prints
Walks: 4andShortest: 20.