Why is c_rating just '+4' when I print - tags:314-7

in ‘counting with dictionaries’ number 7
when i complete the code below the result is ‘+4’ - why is it not the whole list:

opened_file = open(‘AppleStore.csv’)
from csv import reader
read_file = reader(opened_file)
apps_data = list(read_file)
content_ratings = {‘4+’: 0, ‘9+’: 0, ‘12+’: 0, ‘17+’: 0}
for row in apps_data[1:]:
c_rating = row[10]
if c_rating in content_ratings:
content_ratings[c_rating] += 1

print(c_rating)
print(content_ratings)

Hi @francis,

It’s good practice to use proper markdown formatting when asking a question on any forum where code is discussed! Simply put 3 back ticks (```) before and after your code.

From your code, it looks like you should indeed be printing the full list.

Make sure you’re looking at the content_ratings variable being printed. You might only be looking at the c_rating variable that got printed, which is the iterating variable you used in your for loop.