Week 2, Exercise 5, Gradient

I am having a syntax error but I couldn’t see where the mistake is:
File “”, line 41
dw = (1/m) * (np.dot(X,(A-Y).T))
SyntaxError: invalid syntax

Hi @h_eda

This usually happens when there is a mismatch of parenthesis in previous line of code. So check for that.

1 Like

Hi, @h_eda. With SyntaxError “exceptions” that point to the beginning of a line, it is often the case that the problem lies in the syntax of the previous line. Check there for the error, a missing or extra parenthesis, or the like.

1 Like