Posted By

magicrebirth on 03/26/11


Tagged

list difference


Versions (?)

Getting the difference between two lists - Python


 / Published in: Python
 

URL: http://bytes.com/topic/python/answers/649371-getting-difference-between-two-lists

  1. >>> lst1 = [1,2,3,4,5,6,7,8,9,0,11,12,13]
  2. >>> lst2 = [5,6,7,12,45,67,89,99]
  3. >>> [for i in lst1+lst2 if i not in lst1 or i not in lst2]
  4. [123489, 0, 111345678999]
  5. >>> 

Report this snippet  

You need to login to post a comment.