I have two lists in Python, like these:
temp1 = [\'One\', \'Two\', \'Three\', \'Four\']
temp2 = [\'One\', \'Two\']
I need to create a third
def diffList(list1, list2): # returns the difference between two lists.
if len(list1) > len(list2):
return (list(set(list1) - set(list2)))
else:
return (list(set(list2) - set(list1)))
e.g. if list1 = [10, 15, 20, 25, 30, 35, 40]
and list2 = [25, 40, 35]
then the returned list will be output = [10, 20, 30, 15]