5 Answers
New Answerhttps://docs.python.org/3/library/sys.html#sys.getsizeof https://code.sololearn.com/cRP2WcTRdaWc/?ref=app
Actually I was wrong, there is a builtin method to get the size of an object. Any object has a __sizeof__ magic method. (10).__sizeof__() -> 14
Well its because there are a couple bells and whistles of consisting of unbounded numbers
Thanks, I did not expect Python to require that much memory, even boolean required 14 bits. (maybe because there is no such thing as booleans, just integers)
Learn Playing. Play Learning
SoloLearn Inc.
4 Embarcadero Center, Suite 1455Send us a message