Without That
Code from an AI often has things you haven't learned: a function you've never seen, a shorter way of writing something you know. Having them explained is one way. Another is to ask for the same program without them, using only what you know. You then have code you can read, change and fix yourself, and you see what the new thing does by what it saves you.
The program in the editor is the one with enumerate() from before. You don't have to retype the program an answer gives you: a block of code in an answer has a button that copies it, and you paste it into the editor in place of your program.
“The same program” means that it prints the same, and you find that out by running it, not by reading the answer. Code from an AI goes into your program once you've run it.
Instructions
- 1
Attach
script.pyand ask for the same program withoutenumerate(), using only what you know: variables, lists,if,forloops and functions. Then send it. - 2
Copy the program from the answer and paste it into the editor in place of yours. Run it: it prints the same three lines as before.
- 3
Mia walked Rex for 50 minutes today. Add
50at the end of the list and run the program. It prints four lines, the last oneWalk 4: 50 minutes.