a=0100; print a ; 64 how to reverse this?

Daniel no at no.no
Tue Jul 17 14:25:50 CEST 2007


On Tue, 17 Jul 2007 14:09:35 +0300, mosi <skawanagi at gmail.com> wrote:

>
> Problem:
> how to get binary from integer and vice versa?
> The simplest way I know is:
> a = 0100
> a
> 64


Also that is not binary - that is octal, binary would be: '01000000'  
(denoted as a string, since 01000000 in octal is actually 262144 in  
decimal.



More information about the Python-list mailing list