There got locked code blocks and i can’t pass even my answer codes are correct.I already tried many time using with refresh note book and clean copy as the mentors advices.But still can’t fix this issues.Somebody can help me ?
The locked cells contain test cases. You cannot (and should not need to) modify them.
The problem is your code does not pass these tests. So your code needs to be fixed.
Could you check for my answer code is whether correct or not? I’ll directly share my code(screenshot) to you if you can help for me.Thank you.
I believe this topic is being discussed in another thread.
Yes, at Tom says, you also posted this question on a different thread. The problem is that you have modified the indentation in the last few lines of the optimize function in such a way that the return statement and several others are only executed when print_cost = True.
Indentation is part of the syntax in python, unlike most other procedural languages.
Also note that this question is about DLS Course 1, not DLS Course 2. I’ll fix the category by using the little “edit pencil” on the title.
At the very end of your post, you show a screen grab from the test of the two_layer_model function, but it does not include the actual error message. If something is “throwing” there also, please first check your indentation and, if that doesn’t shed any light, please show us the actual error you are getting in the week 4 case.




