First python guided project: profitable app - need help with TypeError: argument of type 'float' is not iterable

I’m working through my first guided project but got stuck with this TypeError: argument of type ‘float’ is not iterable. Can someone please help?

Profitable App Profiles for the App Store and Google Play Markets.ipynb (9.6 KB)

Click here to view the jupyter notebook file in a new tab

Hi @st9540834 and welcome to the community! I changed the category for your post so that it appears in Q&A rather than Share since you have a question and aren’t quite ready to “share” your project yet.

It looks like you’re getting this error because of how you are assigning n_reviews to the dictionary reviews_max without using a key:

reviews_max = {}

for app in googlestore:
    name = app[0]
    n_reviews = float(app[3])
    if name in reviews_max and reviews_max[name] < n_reviews:
        reviews_max = n_reviews          #this is the problem line!
    elif name not in reviews_max:
        reviews_max[name] = n_reviews

Can you see what you need to do to the above commented line of code? Let me know if you can’t see it and we can work on it together.