Guest User

Untitled

a guest
Apr 26th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
  2. b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
  3.  
  4.  
  5. unique =[i for i in a if i in b]
  6. print (unique)
  7.  
  8. import random
  9.  
  10. a = random.sample(range(1,30), 12)
  11. b = random.sample(range(1,30), 16)
  12. result = [i for i in a if i in b]
  13.  
  14.  
  15. x = [1, 2, 3]
  16. y = [5, 10, 15]
  17. customlist = [a*b for a in x for b in y if a*b%2 != 0]
  18.  
  19. print (customlist)
Add Comment
Please, Sign In to add comment