Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##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]
- ##c = []
- ##for x in a:
- ## if x in b and x not in c:
- ## c.append(x)
- ##print (c)
- ##a,b = ra.sample(range(100), 10), ra.sample(range(100),10)
- import random as ra
- # selecting common numbers from 30 results in each of the two random ranges without duplicates
- print (set([x for x in ra.sample(range(50, 200), 30) for y in ra.sample(range(40,300),30) if x==y ]))
Add Comment
Please, Sign In to add comment