Try It in Three Lines
A mistake can also be in what an answer says about Python. Mia's walks this week are a nested list, one list for each day, and the program in the editor checks whether any walk lasted exactly an hour. Say an answer explained it like this:
60 in week goes through every walk of the week, day by day, and is True if one of them is 60 minutes. This week has none, so the program prints Hour-long walk: no.Run the program, and it does print that. But the first sentence is wrong, and this week can't show it: there's no hour-long walk in it, so the program says no whether the claim is right or not. The claim is about how Python works, and what knows that for sure is Python. Ask the assistant whether it's sure, and it may stick to what it said or take it back; either way, you have more words, not a result.
So try the claim on its own, in an experiment: a few lines that do nothing but the thing in question, on data where you know the answer, much like the tests in Tests Come First. Here, that's two days with a walk of 60 minutes on one of them. If the claim is right, 60 in those days is True.
Instructions
- 1
Under the program, write an experiment: a list
testwith two days,[[30], [60]], and a line that prints60 in test. Run it. If the answer were right, the console would end withTrue. It ends withFalse. - 2
Now find out what
indoes look at. Add a line that prints60 in test[1], whether 60 is in the second day's list, and run the program. It printsFalseand thenTrue:incompares 60 with the elements of the list itself, and the elements ofweekare days, not walks.