Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to find missing item in a list

from collections import Counter
target_list = ["one", "two", "three", "four", "five", "one" ]
output_list = ['two','three','four', 'five']
Counter(target_list)-Counter(output_list)

output
Counter({'one': 2})
 
PREVIOUS NEXT
Tagged: #find #missing #item #list
ADD COMMENT
Topic
Name
3+7 =