C5_W2_A2 ell #9. Can't compile the student's code. Error: KeyError('amazing',)

In C5_W2_A2 emojify, I passed all the test, but when grading, I failed.

The error below was found.
#9. Can’t compile the student’s code. Error: KeyError(‘amazing’,)

Please tell me how I can solve this.

Similar problem was posted, but in my case, keyerror(‘amazing’) was occurred, and I couldn’t find same one in former post.

This issue is caused by using a specific word (or word reference) somewhere in the code for the emojify exercise, instead of using code that is portable to use with any data set or test conditions.

The reference to #9 probably means the error is detected in Cell 9, if you count the cells in the notebook starting from #1 at the top.

It would help if you post a screen capture image of the entire error message, rather than a text copy-and-paste.

The reason for the “KeyError(‘amazing’)” is that “amazing” isn’t in the vocabulary the grader uses to check your code, or the grader is looking for “amazing” to appear in the data set, but you’ve hard-coded the data set instead of using the data provided by the grader.

There are lots of ways to write your code so it fails the grader, even if it passes the notebook unit tests.

Thanks!

I could find the reason and solve the error!
As you mentioned, I hardcoded some word.