Skip to content

Instantly share code, notes, and snippets.

@ishashankkumar
Created November 16, 2019 10:44
Show Gist options
  • Save ishashankkumar/d3ee45ee7777b74863abf44871212e6d to your computer and use it in GitHub Desktop.
Save ishashankkumar/d3ee45ee7777b74863abf44871212e6d to your computer and use it in GitHub Desktop.
>>> t1, t2 = (), (1,2,3) #Tuples
>>> sys.getsizeof(t1), sys.getsizeof(t2)
(56, 80)
>>> d1, d2, d3 = {}, {"a":1, "b":2}, {"c":3, "d":4, "e":5} #Dictionary
>>> sys.getsizeof(d1), sys.getsizeof(d2), sys.getsizeof(d3)
(280, 280, 280)
>>> l1, l2 = [], [1,2,3,4] #Lists
>>> sys.getsizeof(l1), sys.getsizeof(l2)
(72, 104)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment