Calculate the average app rating for all the 7,197 apps stored in the dataset.

PHOTO EMBED

Thu Apr 13 2023 09:58:45 GMT+0000 (Coordinated Universal Time)

Saved by @abdishakur #python

opened_file = open('AppleStore.csv')
from csv import reader
read_file = reader(opened_file)
apps_data = list(read_file)

rating_sum = 0
for row in apps_data[1:]:
    rating = float(row[7])
    rating_sum = rating_sum + rating
    
avg_rating = rating_sum / len(apps_data[1:])
print(avg_rating)
content_copyCOPY

https://app.dataquest.io/c/115/m/609/python-for-loops/8/dealing-with-errors