SyntaxError for db | Exercise 5 week 2

    db = (1/m) * np.sum(A - Y)

That’s my code and this is the error I get:

 File "<ipython-input-49-d0b97917396e>", line 44
    db = (1/m) * np.sum(A - Y)
     ^
SyntaxError: invalid syntax

When you get a syntax error at the beginning of a line like that, it means the error is on the previous line. You probably have a missing close parenthesis or close bracket. There is something incomplete about your previous line of code.

The notebook editor is “syntax aware”, so you can use that to check for matching parens. Just click on a paren and it will highlight the matching one. Or not! :scream_cat:

The “meta” principle here is that if you can’t find a syntax error in python that most likely means you are looking in the wrong place. :laughing:

1 Like