Sequence Models: Week 2: Emojify Exercise 1 - sentence_to_avg

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-37-cd40edd34d98> in <module>
      1 # BEGIN UNIT TEST
----> 2 avg = sentence_to_avg("Morrocan couscous is my favorite dish", word_to_vec_map)
      3 print("avg = \n", avg)
      4 
      5 def sentence_to_avg_test(target):

<ipython-input-36-fa085dac459b> in sentence_to_avg(sentence, word_to_vec_map)
     58     #if w in word_to_vec_map
     59     for w in word_to_vec_map[w]:
---> 60         total += word_to_vec_map[w]
     61     avg = total / len(words)
     62 

KeyError: 0.6081

Can someone tell me why I am getting this error?Thank You

Your line 58 is correct. Uncomment it.
Your line 59 is wrong, delete it.

You also modified some of the code that was provided. You should put it back the way it was, and add the correct content.

    # Step 2: average the word vectors. You can loop over the words in the list "words".
    for w in None:
        # Check that word exists in word_to_vec_map
        if w in None:
            avg += None
            # Increment count
            count +=1
          
    if count > 0:
        # Get the average. But only if count > 0
        avg = None