opened_file = open('AppleStore.csv') from csv import reader read_file = reader(opened_file) apps_data = list(read_file) games_social_ratings =  for row in apps_data[1:]: rating = float(row) genre = row if genre == 'Socal Networking' or genre == 'Games': games_social_ratings.append(rating) avg_games_social = sum(games_social_ratings) / len(games_social_ratings) print(avg_games_social)
What I expected to happen:
I expected that the code I ran would be equal to the actual average rating.
What actually happened:
avg_games_social is greater than what we expected. games_social_ratings is shorter than we expected.
I am not sure as to why the output of my code is not what is expected. I even cross-checked it with the solution given by DQ.
If anyone can help, thank you in advance.