[Tutor] Help!

Kwpolska kwpolska at gmail.com
Tue Jan 29 15:50:36 CET 2013


On Mon, Jan 28, 2013 at 10:22 PM, Ghadir Ghasemi
<ghasemmg01 at leedslearning.net> wrote:
> Hi guys I wanted to make a program called Binary/decimal converter.

That’s easy, int('11', 2) and bin(3) should be enough.

> But I want to do it the hard way e.g. not using built in python functions. Can you give me an idea about how I can do that?

Are you crazy or is it an assignment?  Write code according to this:
http://en.wikipedia.org/wiki/Binary_number#Conversion_to_and_from_other_numeral_systems
(or other methods you can find on the Internet or in math textbooks).
Alternatively, you can find out how it is done in other programming
languages or even Python itself.  And use that.

PS. actually, it is impossible to do it in plain Python without using
built-in functions.  Because multiplication, division and
exponentiation and whatnot are built-ins.

OP, please tell your mail provider that it shouldn’t filter
swearwords, and even if it does, that it shouldn’t inform me of that.

-- 
Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16
stop html mail                | always bottom-post
http://asciiribbon.org        | http://caliburn.nl/topposting.html


More information about the Tutor mailing list