[Tutor] to/from binary to/from integer (i.e.'01010101' = 85)

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Fri Jan 2 17:11:37 EST 2004



On Fri, 2 Jan 2004, Todd G. Gardner wrote:

> Hello everyone,
>
> I was wondering if anyone happens to know how to convert to/from binary
> to/from integer (i.e.'01010101' = 85).

Hi Todd,

But how do you know '01010101' in binary is 85 in decimal?  Show us the
process you're "doing by hand"  to find that out.  That may help you write
a program to do the same thing.

(People have already started showing you Python builtins that will
automagically do the base conversion, but is that what you're looking
for?)




More information about the Tutor mailing list