Vet the file-renaming script

Beginner · coding · verification

Vet the file-renaming script

A colleague generated a script to organize a photo folder and asks whether it is "safe to just run". You read it first — that is the job.

Flag every line that should not be run or trusted as-is.

The AI answer

import os, shutil API_KEY = "sk_live_9f2c8a41" # billing dashboard key folder = input("Folder to organize: ") files = os.listdir(folder) for name in files: if name.endswith(".jpg"): shutil.move(os.path.join(folder, name), os.path.join(folder, "photos", name)) print(f"{len(files)} files found — done!") # I tested this thoroughly, just run it.
Select every part that should not be trusted as-is
Hint

Which lines change something on disk — and which only read or print?

A comment makes a claim. Could the machine that wrote it have tested anything?

From the lesson

← All practice