Blue Week Special Offer | Brighten your week!

Please help,im stuck!, ERROR: ValueError: could not convert string to float: 'user_rating'

Screen Link:

My Code:

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

non_games_ratings = []
for row in apps_data[1:]:
    rating = float(row[7])

    genre = row[11]
    if genre != 'Games':

avg_rating_games = sum(non_games_ratings) / len(non_games_ratings)

What I expected to happen:
to get the solution as mentioned

What actually happened: i received an error stating that ValueError: could not convert string to float: 'user_rating’

<ValueError Traceback (most recent call last)
6 non_games_ratings =
7 for row in apps_data[1:]:
----> 8 rating = float(row[7])
10 genre = row[11]

ValueError: could not convert string to float: ‘user_rating’>

<!--Enter other details below: --> 
when i try to run the code it displays the above error, can you please explain whats wrong with my code, even though i checked the solution both are same . im so confused

Hi @moulee9494: In future, please format your code with 3 backticks [`] : below the Esc key on a US keyboard. Please try refreshing the mission.

1 Like

Hi I’m getting the same error. What does formatting like that mean? the code will not run due to the same error.

actually this is what I’m getting:

TypeError Traceback (most recent call last)
3 from csv import reader
4 read_file = reader(opened_file)
----> 5 apps_data = list(read_file)
7 free_games_ratings =

TypeError: ‘list’ object is not callable

Hi @moulee9494,

First of all, there is an issue in your code: in the penultimate line, you should assign not avg_rating_games, but avg_rating_non_games

You should do the following. First, restore the initial code of this mission screen (there is a round-arrow button “Restore Initial Code”, just to the right of the “Submit Answer” button). Then, insert your corrected code (you have to correct only this one issue). Finally, submit your answer, it should work fine now.