Week 2 unexpected indent

Continuing the discussion from [Week2 practice lab error]
[Image deleted by mentor]
in week 2 lab assignment it gives me unexpected indent when i run the code


Kindly remove codes from your post. We are not suppose to post codes on public post, it is against community guidelines. You can always share the screenshot of the error log.

indentation error means you have a space or positional error in relation to the code mentioned in red, place it according to the ## above statement also your next statement should also avoid indentation error.

@Jamal022 Can you please remove this post code, thank you.


As mentioned by @Deepti_Prasad, I’ve removed the code that violates our community guidelines. To resolve the error, ensure that the indentation level of the last two lines within your for loop matches, preventing any indentation errors from occurring.


sorry but when i try to run the code nothing happens it doesnt run neither show anything now is that normal?

It’s a function code so it doesn’t return anything until you call and use it

Does it still shows the same error?

your for statement is not placed at the right place, it should be just below the ## from the above ###start code here and should not start from between.
the for statement has extra space, use back space and run the cell.

Compare the below image with image I am attaching, see how for i statement are placed in the below image is wrong than compared to the attach image which is correct.

This has indentation error :point_down:


for i in range(m):
f_wb =
dj_db +=
dj_dw +=

dj_dw /= 
dj_db /= 
### END CODE HERE ### 

Indentation error can happen if you are copy and pasting your codes. Do not do that.

Place both for i statement and f_wb statement according to this :point_up_2: image


thank you , is there a way to restart the assignment from scratch i mean to undo everything ive done

Hey @Zeyaad_Mahmoud,

You can check this to get the default version of your notebook


1 Like