Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. # creating empty objects
  2. empty_l = [] # list
  3. empty_d = {} # dictionary
  4. empty_s1= set() # set
  5.  
  6. # type check method #1
  7. type(empty_l)
  8. type(empty_d)
  9. type(empty_s1)
  10.  
  11. # type check method #2
  12. empty_l.__class__
  13. empty_d.__class__
  14. empty_s1.__class__
  15.  
  16. # alternative methods of creating empty set
  17. empty_s2 = {*{}}
  18. empty_s3 = {*[]}
  19. empty_s4 = {*()}
  20. empty_s5 = {0}-{0}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement