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

Wildemar Wildenburger wildemar at freakmail.de
Tue Jul 17 14:22:03 EDT 2007


Bruno Desthuilliers wrote:
> mosi a écrit :
>   
>> Problem:
>> how to get binary from integer and vice versa?
>> [snip]
>> What`s the simplest way to do this?
>>     
>
> bruno at bruno:~$ python
> Python 2.5.1 (r251:54863, May  2 2007, 16:56:35)
> [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> help(int)
> Help on class int in module __builtin__:
>
> class int(object)
>   |  int(x[, base]) -> integer
>   

:D

After reading the other two replies, this one made me burst with 
laughter. Thanks for that.
/W



More information about the Python-list mailing list