opened_file = open(‘AppleStore.csv’)
from csv import reader
read_file = reader(opened_file)
apps_data = list(read_file)
for data in apps_data[1:]:
rating = float(row)
genre = row
if genre != 'Games': non_games_ratings.append(rating)
avg_rating_non_games = sum(non_games_ratings) / len(non_games_ratings)
What I expected to happen:
**What actually happened: **
This was the error message
- avg_rating_non_games is less than what we expected.
- non_games_ratings is longer than we expected.
The same code typed above was working perfectly fine in the previous screen (exercise). And even in the solution same code is given. This entire section (Conditional Statements) have this issue. Due to that, I was not able to finish the section. Here’s the link. I believe its some kind of bug, because the code appears to be fine. Here’s the link to the previous screen