Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. from sys import getsizeof as gs
  2.  
  3. list1=[1]
  4. list2=list([1])
  5.  
  6. list1==list2 #true
  7. gs(list1) #80. (I guess 72 overhead +8 of the int)
  8. gs(list2) #104. (I guess 72 + 8 as above + 24 of...?)
  9.  
  10.  
  11. list3=[1,2,3,4,5]
  12. list4=list(list3)
  13.  
  14. gs(list3) #112
  15. gs(list4) #136
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement