Course 2, Week 3 Assignment, Exercise 6

The error messages are not always that precise in terms of interpreting what your mistake might be. Here’s a thread that gives a checklist of possible errors in that function. Of course that is also not guaranteed to cover every possible case, but it’s definitely worth a look.