Week 4, Assignment 2, Application

Unfortunately that np.squeeze is part of the given template code. You’re right that it doesn’t make sense, but it apparently does no harm.

Notice that’s not the only wrong but harmless code in that template section:

if i % 100 == 0 or i == num_iterations:

The way that “for” loops work in python the second condition on that “or” will never be true, right? Contrast that with the boolean expression on the previous “if” which is correct.

Two bugs in four lines of given code, so they’re batting 500 here. :grin:

But the real problem here is that the return statement was part of the template code and should not have been modified, but it looks like Jason got a little creative with that.

Jason, if you want to get a clean copy of the notebook to see how that code originally looked, there is a topic about that on the FAQ Thread.