Sometimes, you have two lists in python and you need too know the difference between two lists. With a quick list comprehension, this is easy to find out: numbers = [1,2,3,4,5,6,7,8] even = [2,4,6,8,10] difference = [ a for a in numbers if not a in even ] print difference The output should be: [1, [...]
↧