Created
January 7, 2016 19:28
-
-
Save libert-xyz/1111b4a5964b0256ad3a 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
##Libert R Schmidt | |
##[email protected] | |
##List Overlap Comprehensions http://www.practicepython.org/exercise/2014/04/10/10-list-overlap-comprehensions.html | |
import random | |
a = random.sample(range(1,50),10) | |
b = random.sample(range(1,50),10) | |
common = [i for i in a if i in b] | |
print(common) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment