Binary

Brain Murphy brianomorchoe at yahoo.co.uk
Fri Jun 8 11:03:44 EDT 2007


I am trying to make a programm that converts a decimal number like 79 to a binary number.
where it asks you for a number then produces the binary.
so far I have this:

x = (input("Enter number: "))
b = 2.0
while x > 0:
    print x
    x = x/b

I need it to show the remainder. like remainder 1 or 0 the put all of them in a list that is backwards.
Any Ideas


      ___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070608/aa7bf882/attachment.html>


More information about the Python-list mailing list