Finding how much memory does a object consume.
Today's repo is about finding how much memory a object in python consumes.
So the takeaway is while programming in python you can know how much difference it's makes and so0 choosing right data type could possibly lead to a clean and optimized code.
code
size_1 = ["I","am","groot"]
size_2 = ("I","am","groot")
here we took a list and a tuple let's find out how much memory they consume for same amount of data.
output:
size of list: 120
size of tuple: 64