Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #6087

Re: Is there a better way to solve this?

Newsgroups comp.lang.python
Date 2011-05-23 11:55 -0700
Subject Re: Is there a better way to solve this?
From kracekumar ramaraju <kracethekingmaker@gmail.com>
Message-ID <mailman.1983.1306176915.9059.python-list@python.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Is there a better way to solve this? kracekumar ramaraju <kracethekingmaker@gmail.com> - 2011-05-23 11:55 -0700
  Re: Is there a better way to solve this? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-24 00:03 +0000

csiph-web