Blue Week Special Offer | Brighten your week!
days
hours
minutes
seconds

Why my solution doesn't work?

Screen Link:
https://app.dataquest.io/m/313/conditional-statements/7/combining-logical-operators

My Code:

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

free_games_social_ratings =
nonfree_games_social_ratings =
for row in apps_data[1:]:
rating = float(row[7])
genre = row[11]
price = float(row[4])

if (genre == 'Social Networking' or genre == 'Games') and price == 0:
    free_games_social_ratings.append(rating)
if (genre == 'Social Networking'or genre == 'Games') and price != 0:
    nonfree_games_social_ratings.append(rating)

avg_free = sum(free_games_social_ratings) / len(free_games_social_ratings)

avg_non_free = sum(nonfree_games_social_ratings / len(nonfree_games_social_ratings)
Replace this line with your code


What I expected to happen:
The code should append the free and the non-free apps to two seperate lists.

What actually happened: 

```  File "<ipython-input-1-33091e3fb0d3>", line 20
    avg_non_free = sum(nonfree_games_social_ratings / len(nonfree_games_social_ratings)
                                                                                       ^
SyntaxError: unexpected EOF while parsing
Replace this line with the output/error

I have seen the solution in the Mission and it make sense for me. But my solution should also work because i go thru the Dataset and check if the apps are free or not. I’m thankful for every input why my solution doesn’t work :slight_smile:
Thanks!

Simo

You forgot to close the parenthesis. This is what caused the SyntaxError

Thanks! I didn’t see that Detail :slight_smile: