Project 1 - Create a dictionary and remove duplicates (code logic help)

Hi everyone,
I am a newbie and having difficulty understanding the code logic that relates to creating a dictionary and removing duplicate data, in step five of project one. I am available to do zoom call or phone call at your convenience. Please know that I do not have a code error, I only need help understanding the code. Project 1 Thank you in advance!

Please see step five code below that I need help understanding.

reviews_max = {}
for app in android:
    name = app[0]
    n_reviews = float(app[3])
    if name in reviews_max and reviews_max[name] < n_reviews:
        reviews_max[name] = n_reviews
    elif name not in reviews_max:
            reviews_max[name] = n_reviews
    
print(len(reviews_max))

android_clean = []
already_added = []
for row in android:
    name = row[0]
    n_reviews = float(row[3])
    if reviews_max[name] == n_reviews and name not in already_added:
        android_clean.append(app)
        already_added.append(name)

Hi @mustafa.s.albassam and welcome to the community! You may want to hide your phone number as this is a public forum. It would probably be better to send that to someone in a private message. Also, please take a look at this post for some great tips on asking technical questions in the community; specifically please provide a link to the mission/guided project you’re working on for context.

What code have you written so far for this task? Can you share and format that code please? Are you getting any error messages, if so, what are they?

It appears the instructions only have two steps…or am I missing something?

I am making lunch at the moment but could be available for a zoom call afterwards…

Hi Mike,
Thanks for reaching out to help. I am at work, can we meet tomorrow at 12 noon EST time zone or after 5pm. If so, I will send the zoom link later. Thank you again.

Thanks for fixing up your post…it looks much better.

Sure, meeting up tomorrow sounds great! Just send me a private message with the details when you get a chance and we can meet up at a convenient time.

Sounds great, thank you for offering to help. Will send you the zoom link later.

Thank you again

1 Like