def find_unique(sequence):
    item_counter = dict()
    uniques = list()

    for item in sequence:
        if item not in item_counter:
            item_counter[item] = 1
        else:
            item_counter[item] += 1

    for item, item_count in item_counter.items():
        if item_count == 1:
            uniques.append(item)

    return uniques

test_sequence_list = [2,'a','l',3,'l',4,'k',2,3,4,'a',6,'c',4,'m',6,'m','k',9,10,9,8,7,8,10,7]

print(find_unique(test_sequence_list))


import collections

def find_unique(sequence):
    counter_dict = collections.defaultdict(int)
    uniques = []

    for item in sequence:
        counter_dict[item] += 1

    for item, count in counter_dict.items():
        if count == 1:
            uniques.append(item)

    return uniques

test_sequence_list = [2,'a','l',3,'l',4,'k',2,3,4,'a',6,'c',4,'m',6,'m','k',9,10,9,8,7,8,10,7]

print(find_unique(test_sequence_list))


Change logic to use defaultdict, lists initiate now with
Change logic to use defaultdict, lists initiate now with []

+ import collections
+ 
  def find_unique(sequence):
-     item_counter = dict()
+     counter_dict = collections.defaultdict(int)
-     uniques = list()
+     uniques = []
  
      for item in sequence:
-         if item not in item_counter:
-             item_counter[item] = 1
-         else:
-             item_counter[item] += 1
+         counter_dict[item] += 1
  
-     for item, item_count in item_counter.items():
+     for item, count in counter_dict.items():
-         if item_count == 1:
+         if count == 1:
              uniques.append(item)
  
      return uniques
  
  test_sequence_list = [2,'a','l',3,'l',4,'k',2,3,4,'a',6,'c',4,'m',6,'m','k',9,10,9,8,7,8,10,7]
  
  print(find_unique(test_sequence_list))
  
  
Change logic to use defaultdict, lists initiate now with
## Code Before:
def find_unique(sequence):
    item_counter = dict()
    uniques = list()

    for item in sequence:
        if item not in item_counter:
            item_counter[item] = 1
        else:
            item_counter[item] += 1

    for item, item_count in item_counter.items():
        if item_count == 1:
            uniques.append(item)

    return uniques

test_sequence_list = [2,'a','l',3,'l',4,'k',2,3,4,'a',6,'c',4,'m',6,'m','k',9,10,9,8,7,8,10,7]

print(find_unique(test_sequence_list))


## Instruction:
Change logic to use defaultdict, lists initiate now with
## Code After:
import collections

def find_unique(sequence):
    counter_dict = collections.defaultdict(int)
    uniques = []

    for item in sequence:
        counter_dict[item] += 1

    for item, count in counter_dict.items():
        if count == 1:
            uniques.append(item)

    return uniques

test_sequence_list = [2,'a','l',3,'l',4,'k',2,3,4,'a',6,'c',4,'m',6,'m','k',9,10,9,8,7,8,10,7]

print(find_unique(test_sequence_list))

