W3 Assignment help - exercise 1 Submission Error

Hi there, I keep getting this error when I submit my assignment:

I’m sure my code is correct and passed the system test, so I don’t know what does this error mean, please help thanks so much!!

You filed this question under “General Discussion”, but I don’t recognize the assignment you show from DLS (which is the specialization I’m familiar with). Generally speaking you’ll have better luck getting the attention of the right people who know how to help if you file the questions under the category of the specialization and course you are working on. You can move the thread by using the little “edit pencil” on the title. Or if you just reply and give the info, I can move it for you.

Just generally speaking without knowing the details of that assignment, my guess is that there is a mistake later in the assignment than the section that you show that is causing this error. Are you sure you did “Cell → Run All” and then scanned all the way through to make sure no errors are being “thrown” when you run the notebook yourself before you hit “Submit Assignment”?

If everything runs correctly locally, then the error is something more subtle and the nature of the problem is that your code is not “general”: it works with the specific tests in the notebook, but fails when the grader calls your functions with different inputs. For example, one thing that can cause that sort of error is referencing global variables from within the local scope of your functions. Then perhaps that global variable either doesn’t exist in the grader context or it’s defined as a different data type, which might cause the specific type of error that you’re seeing from the grader.