Week 2 Assignment 2 Exercise 3

I have the error message of “AssertionError: Wrong values. Debug with the given examples”.

I wonder the problem is about the line of “if w in sentence_words:”

The following is my implementations. Please help, thanks so much!

{mentor edit: image of code removed - not allowed by the Honor Code}

The following is the error message:

Hi @fireping668 ,

The last ‘for’ loop should be looping over the words from sentence_words, not word_to_index, and the ‘if’ statement is to check the word is in the word_to_index.

Thanks so much. Solved.