Is there a better way to solve this?

kracekumar ramaraju kracethekingmaker at gmail.com
Mon May 23 14:55:08 EDT 2011


You can use sizeof function,
>>> a=12234
>>> b=23456.8
>>> a.__sizeof__()
12
>>> b.__sizeof__()
16
So sizeof int is 12 bytes and float is 16 bytes



More information about the Python-list mailing list