Blue Week Special Offer | Brighten your week!
days
hours
minutes
seconds

Question on Juypter Notebook regarding the conditionals of duplicates and unique apps

for row in google_data:
name = row[0]
if name in unique_apps:
duplicate_apps.append(name)
else:
unique_apps.append(name)

I know that this code will bring me the amount of apps which are duplicated on the Android Store. But I am confused on how. I get the for loop section, but I do not get the conditional section. How does:

if name in unique_apps:
duplicate_apps.append(name)
else:
unique_apps.append(name)

Automatically sort out which apps are duplicated and which apps aren’t despite duplicate_apps and unique_apps being simply empty lists?
In addition, I only typed in “if name in unique_apps:
duplicate_apps.append(names)”
gives me the output 0. But the else statement changes all that. So I am confused; how does this whole conditional statement sort out the apps which are duplicated and which ones arent?

Please make sure that you edit your post based on the guidelines mentioned in this post - Guidelines for asking a technical question in our Community . Especially guidelines 3 and 4.