Question: This code cell converts the data from the file into a list of integer values, and stores the result in variable Answer 1 . It
This code cell converts the data from the file into a list of integer values, and stores the result in variable Answer It also prints Answer so you can see the result. WebCAT will grade the contents of Answer
But, there is a bug. First, run the entire notebook click "Kernel Restart and Run All" or the FastForward button on the toolbar Notice the printed results here are incorrect, displaying an empty list. Why?
Now immediately run this code cell again click the cell, then shiftenter Magically the correct Answer is shown containing several integer values. Why did it change? Hint: See the code in Problem Python maintains state, despite out of order interactive execution, code edits, etc.
So you might think that the result is now correct and can be submitted to WebCAT. No WebCAT will run the code cells in order from scratch, and produce the wrong result in AnswerThis code cell converts the data from the file into a list of integer values, and stores the result in variable Answer It also prints Answer so you can see the result. WebCAT will grade the contents of Answer
But, there is a bug. First, run the entire notebook click "Kernel Restart and Run All" or the FastForward button on the toolbar Notice the printed results here are incorrect, displaying an empty list. Why?
Now immediately run this code cell again click the cell, then shiftenter Magically the correct Answer is shown containing several integer values. Why did it change? Hint: See the code in Problem Python maintains state, despite out of order interactive execution, code edits, etc.
So you might think that the result is now correct and can be submitted to WebCAT. No WebCAT will run the code cells in order from scratch, and produce the wrong result in Answer
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
