devxlogo

Get the Size of an Object in Python

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))

devx-admin

Share the Post: