Noob questions about Python

Paul Hankin paul.hankin at gmail.com
Wed Oct 17 16:33:06 EDT 2007


On Oct 17, 8:37 pm, Ixiaus <parnel... at comcast.net> wrote:
> I have a few questions regarding Python behavior...
> as the integer 72 instead of returning 00110, why does Python do that?
> (and how can I get around it?)

You can do this:

def bin(x):
    return int(x, 2)

val = bin('00110')

--
Paul Hankin




More information about the Python-list mailing list