Explained at Your Level
An explanation helps only if you can follow it. The AI doesn't know what you've learned, so it explains for anyone, in the words a programmer would use. Tell it what you know, and it can build on that.
The program in the editor uses enumerate(), which you haven't met yet. You'll find things you haven't learned in code from an AI, and in code from anywhere else, all the time, and that's what asking is for. Asked only Explain this program., one answer said, correctly:
enumerate(walks, start=1) pairs each item in the list with a counter. The counter starts at 1 (because of start=1), not the default 0.
On each pass, the counter is assigned to number and the item (the minutes) is assigned to minutes. Python unpacks the pair into those two variables.That's right, and it's written for someone who already knows what a pair is and what unpacking means. The same message gets a different answer each time, but the others were much like this one. A message that gets an explanation you can follow says:
- what you want: the program explained line by line;
- what you know: variables, lists,
if,forloops and functions; - what's new to you: here,
enumerate().
Instructions
- 1
Attach
script.pyand add to the message what you know and what you don't: you know variables, lists,if,forloops and functions, and you haven't learnedenumerate(). Ask for the program to be explained line by line, with what you know. Then send it.