Created
April 13, 2015 06:04
-
-
Save darthShadow/7acd33025944bd5bafb6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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