Guided Project: Profitable Apps -- problem with determining most popular app by genre

The image below includes my code and the output after running:

I expected that the code would return a list of all of the genres followed by their average number of user ratings, like is shown in the provided solutions. It looks like this (continued with more rows:
ART_AND_DESIGN : 1986335.0877192982
AUTO_AND_VEHICLES : 647317.8170731707
BEAUTY : 513151.88679245283
BOOKS_AND_REFERENCE : 8767811.894736841
BUSINESS : 1712290.1474201474
COMICS : 817657.2727272727
COMMUNICATION : 38456119.167247385
DATING : 854028.8303030303
EDUCATION : 1833495.145631068

However, you can see above that what actually happened, is that it only returned the Music genre, leaving out all of the other genres. I have gone back and compared my code to the DataQuest provided solutions, and they seem to be exactly the same. I’m not sure why I am not getting the same output.

hey @ricekd2
welcome to DQ community! For a first post, thanks for detailing your query and explaining to us what exactly the issue is. :slight_smile:

The print statement is outside the for loop. that should be why only the last row is getting printed.
trying indenting the print statement to bring it exactly below “genre_average_ratings…”

1 Like

That was the issue. Thanks for the help!

1 Like