Re: Can string formatting be used to convert an integer to its binary form ?



Mirco Wahab:
But where is the %b in Python?

Python doesn't have that. You can convert the number to a hex, and then
map the hex digitds to binary strings using a dictionary, like this:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440528

Bye,
bearophile

.



Relevant Pages