C1_W2_Linear_Regression, cost-sum

Hello, I am stuck (Indentation Error: cost_sum) for the week2 assignment, C1_W2_Linear_Regression.
How to calculate cost_sum? Thank you.

Hello @Nyein_Thu_Thu_Aung . You have added one extra space before line
cost_sum = cost_sum + cost
I think if you delete the extra space and then rerun the cell, your error will vanish.
Python is a programming language where proper indentation(spaces before each line) is very important as there are no curly brackets{}, like other languages (C, C++,…).

2 Likes

@ritik5
Thank you so much, I will be aware and notice of this mistake in the future.

1 Like

We can’t share assignment code here, so I have removed it.

Raymond

Be extremely careful with indentation.
Hint: Check that all of the code you want to execute inside the for-loop is indented to the same depth.

1 Like