Excuse me, what is returned by python getsizeof?

Hello everyone, may I ask python sys.getsizeof to return the size of a variable in memory, is this size b or kb?

Nov.27,2021

Python provides the function getsizeof in the sys module to calculate the size of the Python object.

sys.getsizeof (object [, default])

returns the object size in bytes (byte).

the data store is represented in decimal, and the data transfer is represented in binary, so 1KB is not equal to 1000B.


this size is a number without a size.
kb is about 1024b

Menu