Skip to content

Python code snippet – How much memory does a variable need?

from sys import getsizeof
a = 42
getsizeof(a) # size of object in bytes
See also  How to initialize array in Java?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.