This part is provided to me and i just open the jupyter notebook and only type 4 lines to initialize w,b and run that part this is occurring in week 4 assignment.
Check the line before that line to make sure you are not missing a close paren. The other thing to be careful of is that indentation is part of the syntax in python. You can’t just line things up the way you like: you have to know and follow the rules. If you accidentally changed any of the indentation, that can cause this type of problem. Although typically the parser will say “indentation” in the error message, if that’s what it is complaining about.
Exactly: you were missing the close paren on the previous line with the np.zeros call.
This might seem weird, but you have to think like the parser: it knows it’s missing the close paren, so it keeps looking forward onto the next line hoping to find the completion. But then when it sees something that conflicts with what it is expecting, that’s where it throws the error. That’s why the error message shows up after the point of the real error. But you could view this as just the same as when you pass a bad parameter down to a subroutine: the error gets thrown in perfectly correct code in the subroutine and you have to track backwards up the call stack to find the actual error. This is all part of debugging.