Ratings.append not defined error message

Screen Link:

My Code:
///opened_file = open(‘AppleStore.csv’)
from csv import reader
read_file = reader(opened_file)
apps_data = list(read_file)
ratings =

for row in apps_data[1:]:
rating = float(row[7])
price = float(row[4])
if price > 9:
ratings_append(rating)

avg_rating = sum(ratings) / len(ratings)
n_apps_more_9 = len(ratings)
n_apps_less_9 = len(apps_data[1:]) - len(ratings)
Replace this line with your code


What I expected to happen: Should output the avg_rating


What actually happened: 
I got this error message -
NameError                                 Traceback (most recent call last)
<ipython-input-1-e67031386ad6> in <module>
      9     price = float(row[4])
     10     if price > 9:
---> 11         ratings_append(rating)
     12 
     13 

NameError: name 'ratings_append' is not defined

Replace this line with the output/error


<!--Enter other details below: --> Don't understand why I got the error message ratings_append is not defined. I checked the answer section and it shows I got it right. So why did I get that error message?
1 Like

Hey @dseto200,

you are using "ratings_append(rating) instead of “ratings.append(rating)”.

I think this is the main reason for this error.

I hope it helps :smile:

Thanks missed the easiest part. :grinning:

1 Like

It happens to everybody! Glad that you solved :grin: