I think you are taking a fundamentally incorrect approach here. It looks like you are modifying the test or “checking” code that is used to evaluate your code. Here’s what the “clean” version of that cell looks like in a fresh notebook:
# Reshape the training and test examples
#(≈ 2 lines of code)
# train_set_x_flatten = ...
# test_set_x_flatten = ...
# YOUR CODE STARTS HERE
# YOUR CODE ENDS HERE
# Check that the first 10 pixels of the second image are in the correct place
assert np.alltrue(train_set_x_flatten[0:10, 1] == [196, 192, 190, 193, 186, 182, 188, 179, 174, 213]), "Wrong solution. Use (X.shape[0], -1).T."
assert np.alltrue(test_set_x_flatten[0:10, 1] == [115, 110, 111, 137, 129, 129, 155, 146, 145, 159]), "Wrong solution. Use (X.shape[0], -1).T."
print ("train_set_x_flatten shape: " + str(train_set_x_flatten.shape))
print ("train_set_y shape: " + str(train_set_y.shape))
print ("test_set_x_flatten shape: " + str(test_set_x_flatten.shape))
print ("test_set_y shape: " + str(test_set_y.shape))
Notice that the assert statements reference train_set_x_flatten, not x or X. So why did you change that code? You should only need to fill in the code in the “YOUR CODE HERE” sections. If the tests fail, the solution is not to change the tests: it is to understand why your code fails the tests.
My suggestion would be to just rename your current notebook aside and get a fresh copy and start over. There are instructions for how to get a clean copy on the first topic on the DLS FAQ Thread.
If this your first exposure to any kind of computer programming, please realize that this course is not designed as an introduction to python programming: it assumes you are already a reasonably competent python programmer. If this is your first time programming, it might be a better plan to go take an “intro to python” course first and then come back here to learn Deep Learning.
Just to close the loop on the public thread, I had a DM conversation with Chukwu and there was a simple error in the “flatten” logic that did not look like it was a problem of not understanding python syntax. One line was correct, but the other did not match.
The problem is that you have accidentally converted the cell for backward_propagation from a code cell into a “markdown” or documentation cell, so that there is no function there. There is a way in the UI to convert a cell from code to markdown and markdown to code (Cell -> Cell Type), but if you can’t figure out how to do that, the other good strategy is just to get a clean copy of the notebook and “copy/paste” over your completed work. There is a topic about that on the DLS FAQ Thread.