Get the Size of an Object in Python

Use getsizeof method to retrieve the size of an object in bytes. See below for an example:

str = "devx" print(sys.getsizeof(str))
Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: