Skip to content

make_something

Ask AI to change your code, then check it really worked

This is where you are going. Five dog photos in your folder instead of one, and you did not write the change yourself. You asked for it.

what is in your folder at the end

dog1.jpg dog2.jpg dog3.jpg dog4.jpg dog5.jpg

The interesting part is not getting the code. That is the easy bit now. The interesting part is that you can be handed code that says it worked, watch it say it worked, and end up with one photo instead of five. This page shows you exactly that happening, so you can spot it.

Start from the program that fetches one dog photo. You need that working first.

What to ask for

Give the assistant your working program and say what you want, in plain words. Being specific is the whole skill. Vague questions get vague code.

Here is my Python program. Change it so it saves five dog photos instead of one, and explain what you changed. (then paste your program underneath)

Notice the second half. Asking it to explain what it changed is not politeness, it gives you something you can check the code against.

Now the part nobody tells you

Here are two versions. Read them. One of them is wrong. Do not scroll down until you have had a real go at spotting which.

Only one line differs, and it is the short one in the middle. On a phone the longer lines slide sideways, but you will not need them.

version a

import urllib.request, json

url = "https://dog.ceo/api/breeds/image/random"

for i in range(5):
    with urllib.request.urlopen(url) as answer:
        dog = json.load(answer)

    name = "dog.jpg"

    urllib.request.urlretrieve(dog["message"], name)
    print("Saved dog", i + 1)

version b

import urllib.request, json

url = "https://dog.ceo/api/breeds/image/random"

for i in range(5):
    with urllib.request.urlopen(url) as answer:
        dog = json.load(answer)

    name = f"dog{i + 1}.jpg"

    urllib.request.urlretrieve(dog["message"], name)
    print("Saved dog", i + 1)

both_printed_this

Saved dog 1 Saved dog 2 Saved dog 3 Saved dog 4 Saved dog 5

Identical. Five cheerful lines each. We ran both.

Version A left one file in the folder. Version B left five.

Version A saves every photo with the same name, so each dog writes over the one before it. It downloaded five dogs and threw four of them away, and told you it had saved five, because saving five is genuinely what it did. It just did not keep them.

The check that actually works

Reading the code did not catch it. Reading the output did not catch it, because the output was a lie told honestly. The thing that catches it takes four seconds:

Go and look at what it made

Open the folder. Count the files. You asked for five and there is one, so it is wrong, and you knew within seconds without understanding a single line.

That is the habit worth taking from this page, and it works on everything, not just code from an assistant. Your own programs will lie to you in exactly the same way. A program telling you it worked is the program's opinion. The folder is the fact.

What to do when you catch one

Go back and say what actually happened, not just that it was wrong. "It printed saved dog five times but there is only one file in the folder" gets you a fix. "It doesn't work" gets you a guess.

Describing a fault precisely is most of what fixing things is. You are now doing the part of the job that does not go away.

Try to break it yourself

prove it

Run version A yourself

Do not take our word for it. Run it, count the files, and watch a program tell you five things happened when one did.

ask better

Ask for twenty, in a folder

Ask for twenty photos saved into a new folder called dogs. Then count. Twenty is harder to fake than five.

harder

Make it count for you

Ask for a last line that prints how many files it actually saved, by looking at the folder rather than by counting how many times it went round the loop. Those are different numbers, and that difference is the whole lesson.

think

Where else would this hide?

If a program said it sent thirty messages, or saved your homework, how would you check it rather than believe it? Same question, bigger stakes.

for_the_adult_in_the_room

This page assumes a child already has supervised access to an AI assistant. Most of them set a minimum age of 13, and some require an adult account below that, so please check the terms of whichever one you use rather than assuming. Nothing on this page needs an account to be useful: the two versions and the folder check work on their own, and the point of the page is the checking habit rather than the assistant.

We have deliberately not named a particular assistant. They change constantly and we have nothing to sell you.

All the things you can make

your_progress

Caught the wrong version? Tick it off.

Kept in this browser only. No account, no sign up, and nothing about you reaches us.