a = [1, 2, 3, 4, 5] b = [6, 7, 8, 9, 10] print(a+b) # [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a = [1, 2, 3, 4, 5] b = [3, 4, 5, 6, 7] temp = [i for i in a if i not in b] # a-b print(temp) # [1, 2]
from collections import Counter list(Counter(participant) - Counter(completion)) # import collections list(collections.Counter(participant)-collections.Counter(completion))