Python Invalid syntax error

That type of error at the beginning a line means there is something wrong (incomplete) about the previous line. Take a more careful look at the parens on the previous line. Note that the notebook editor is syntax aware: if you click on a paren or a brace, it will show you the matching one. Or not! :scream_cat:

The “meta” lesson here is that if you can’t find a python syntax error, it probably means you are looking in the wrong place. :nerd_face:

Thanks a lot for your help :slight_smile:

I’m glad that it helped! For future reference, note that you posted this under “General Discussion”. Fortunately it was generic enough that I could recognize the error, even though I’m not a mentor MLS or M4ML, which is where I’m guessing this assignment is from. You’ll have a better chance of getting a quick answer from the right people if you create the thread in the subforum that is appropriate for the course and week of the material you are asking about.

1 Like