Incorrect Output from First Guided Project

Screen Link: https://app.dataquest.io/c/112/m/350/guided-project%3A-profitable-app-profiles-for-the-app-store-and-google-play-markets/11/most-common-apps-by-genre-part-three

My Code:

genres_ios = freq_table(free_apps_ios,-5)#    genre is iteration_variable here
for genre in genres_ios:
    total= 0 
    len_genre = 0 
    for row in free_apps_ios: 
        genre_app = row[-5]
        if genre_app==genre:
            ratings = float(row[5])
            total += ratings
            len_genre +=1 
    average = total/len_genre 
    print(genre,':',total)

What I expected to happen: output from solution notebook

What actually happened:

Social Networking : 7584125.0
Photo & Video : 4550647.0
Games : 42705967.0
Music : 3783551.0
Reference : 1348958.0
Health & Fitness : 1514371.0
Weather : 1463837.0
Utilities : 1513441.0
Travel : 1129752.0
Shopping : 2261254.0
News : 913665.0
Navigation : 516542.0
Lifestyle : 840774.0
Entertainment : 3563577.0
Food & Drink : 866682.0
Sports : 1587614.0
Book : 556619.0
Finance : 1132846.0
Education : 826470.0
Productivity : 1177591.0
Business : 127349.0
Catalogs : 16016.0
Medical : 3672.0

<The frequency table and display frequency functions from the screen before output correctly. It’s a this step where my output is wrong. Similar problem with android set. Why an I not getting the correct output?–>

Because you are not printing the average number of ratings as required.

You are printing the total instead. Modifying the above accordingly should result in the desired output.