For the first programming assignment in Improving Deep Neural Networks: Hyperparameter Tuning, Regularization and… I don’t understand why I am getting a syntax error for this line of code.
File "<ipython-input-9-a57500570b3a>", line 25 if (l == 1)
^
SyntaxError: invalid syntax
I want the code to check if l equals 1 so I can use the proper argument in the call to the np.zeros function.
Are you sure you’re not missing a close paren on the previous line? That’s usually the cause when you get a syntax error at the beginning of a line. Well, the other is indentation issues, but usually the error message is explicit in that case.