Noob questions about Python

Paul Hankin paul.hankin at
Wed Oct 17 22:33:06 CEST 2007

On Oct 17, 8:37 pm, Ixiaus <parnel... at> 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