Binary numbers

Kent Johnson kent37 at
Wed Jun 8 02:56:39 CEST 2005

Douglas Soares de Andrade wrote:
> Hi !
> How to work with binary numbers in python ? Is there a way to print a number 
> in its binary form like we do with oct() or hex() ?

This is a popular topic in the Python Cookbook, maybe one of these recipes will suit you:


More information about the Python-list mailing list