def distinct_naive_verbose(items): """ This naive and verbose implementation returns distinct elements of a list. """ results = list() # iterate through all items for item in items: member = False # linear search for the actual item in results for result in results: if item == result: member = True break # if we didn't find the item in results it is unique and we append to the results if not member: results.append(item) return results