C1_W4 Qnc_1 get_matrices

Hi folks,
I am getting keyerror for the first test
Here is snap of my code,
{IMAGES REMOVED AS IT INCLUDED CODES FROM GRADED CELL}
I am getting this type of error message


If anyone has idea, please share with me how to solve it

1 Like

You cannot share codes from assignments which will grade your codes.

1 Like

It looks like you’ve done the right thing in that your logic is trying to check that the words are both in their respective dictionaries. But the problem is that you did not initialize the set english_set correctly: you did not use the english embedding dictionary for that. Compare to how you initialized french_set.

3 Likes

Hello @Shriganesh_98

What @paulinpaloalto is conveying you is perfectly the right hint :clap:

For the below code, you used the correct keys in dictionary
get the french words (keys in the dictionary) and store in a set()

But for get the english words (the keys in the dictionary) and store in a set()
You have used english-french dictionary key, hence getting the error.

Regards
DP

2 Likes

Thank you @paulinpaloalto. I corrected that.
Also Thanks to @Deepti_Prasad.
Happy learning

2 Likes