Skip to content

Instantly share code, notes, and snippets.

@darthShadow
Created April 13, 2015 06:04
Show Gist options
  • Save darthShadow/7acd33025944bd5bafb6 to your computer and use it in GitHub Desktop.
Save darthShadow/7acd33025944bd5bafb6 to your computer and use it in GitHub Desktop.
# Author : Anagh Kumar Baranwal
# Question : http://www.practicepython.org/exercise/2014/03/05/05-list-overlap.html
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
intersection_set = sorted([num for num in a if num not in b] + [num for num in b if num not in a])
print(intersection_set)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment