Find Duplicates

Run Settings
LanguagePython
Language Version
Run Command
# Exercise: Check for duplicates in list: some_list = ['a', 'b', 'c', 'b', 'd', 'm', 'n', 'n'] other_list = [] duplicates = [] for item in some_list: if item not in other_list: other_list.append(item) else: duplicates.append(item) print(duplicates) # OR for item in some_list: if some_list.count(item) > 1: if item not in duplicates: duplicates.append(item) print(duplicates)
Editor Settings
Theme
Key bindings
Full width
Lines