Things That Aren't Here
An answer can be right about Python and still not work where your program runs. The assistant can't see where that is, so unless you say it, it writes for an ordinary computer, with your files on it and any library it needs installed. A library is code that other people wrote, which a program takes in with import; on a computer of your own, you install the ones you need.
Your programs here run in your browser, on this page. There are no files of yours for them to open, and the libraries you'd install on your own computer aren't installed here. An answer that saves Mia's walks to a spreadsheet with the library openpyxl, for example, stops at its first line:
Traceback (most recent call last):
File "<exec>", line 1, in <module>
ModuleNotFoundError: No module named 'openpyxl'Such an error doesn't mean that the answer made something up: openpyxl exists, and a file the program opens may well exist on someone's computer. It means that it isn't here, and only you know that. Ask without saying it, and you get help for another computer: sent the program in the editor and its error with just How do I fix this?, one answer suggested creating the file, checking which folder Python runs in, and writing out the file's whole path.
In Say What the Code Should Do, you told the assistant where a program runs. Whoever got this one didn't: it reads Mia's walks from a file, walks.txt, with a number of minutes on each line. Her walks this week were 30, 45, 20, 60 and 25 minutes.
Instructions
- 1
Run the program: it ends with a
FileNotFoundError. Attachscript.pyand, with the console's button, what it printed. Say where the program runs: in a browser, on a learning site, where it can't open files or install libraries. Give Mia's walks, and ask for a version that works there. Then send it. - 2
Copy the program from the answer, paste it into the editor in place of yours, and run it. It prints
Walks: 5andTotal: 180.