W4_A1_Ex-5_Dimension not aligned

Yes! My guess is just that you confused yourself by not actually executing the code after you modified it. Just typing new code in a function cell and then calling the function again does nothing: it just runs the old version of the code. You have to actually click “Shift-Enter” on the function cell itself in order to get the new code “compiled” (well, interpreted really, but the point is the same).

Now that you are aware of this, you can easily demonstrate how it works. Take a function that works and purposely change the code to break it. E.g. multiply the correct answer by 2. Now run the test cell again. It still works, right? Now click “Shift-Enter” on the function cell and then run the test again. Kaboom!

1 Like