Advertisement
ph4x35ccb

Set comprehensions

Feb 1st, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. #! /usr/bin/env/python
  2. #coding:UTF-8
  3.  
  4. set1={1,2}
  5. set2={3,4}
  6. set_comprehensions = {i+i for i in range(0,10)}
  7. print(set_comprehensions)
  8.  
  9. set_comprehensions_2 = {i for i in set1.union(set2)}
  10. print(set_comprehensions_2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement