Hello, I have a doubt regarding the column index. I wrote this code in pycharm and the output is the same as the answer of the exercise but it’s showing an error when I submit the answer. I had to change the column index to 7 in order to get it right. Can someone help me understand why am I getting the correct result using 8 as the column index in pycham but dataquest is not accepting it?
import csv
opened_file = open(‘AppleStore.csv’, encoding=“utf8”)
read_file = csv.reader(opened_file)
apps_data = list(read_file)header = apps_data[0]
rating_sum = 0for row in apps_data[1:]:
rating = float(row[8])
rating_sum = rating_sum + ratingrow_count = len(apps_data[1:])
avg_rating = rating_sum / row_count
print(avg_rating)