I have two lists in Python, like these:
temp1 = [\'One\', \'Two\', \'Three\', \'Four\'] temp2 = [\'One\', \'Two\']
I need to create a third
most simple way,
use set().difference(set())
list_a = [1,2,3] list_b = [2,3] print set(list_a).difference(set(list_b))
answer is set([1])
set([1])
can print as a list,
print list(set(list_a).difference(set(list_b)))