KeyError on List data type

C1M4_Assignment Ex_2

I keep getting KeyError - the data type is List not Dictionary

I checked the data type of candy_data, and it is a list. But I can’t seem to move forward on this exercise, and I’m not sure where the problem is

START CODE HERE

Use ‘get_popularity_scores’ and pass in the lst candy_data

popularity_scores = # Add your code here

for row in candy_data[1:]:
score = get_popularity_scores(row[1])
popularity_scores.append(score)

END CODE HERE

Print the popularity_scores list

print_scores(popularity_scores)

The function get_popularity_scores is defined so that it takes the candy_data list and extracts the Popularity Score, so you don’t need to iterate over each row of the data. Per the instructions, you should "#Use ‘get_popularity_scores’ and pass in the lst candy_data". So you should use the function get_popularity_scores directly in the format function_name(list_name), on the same line as “#Add your code here”. Please let me know if this helps.

Thank you, it works.