Converting an integer to base 2

Luke LLoeffler at
Fri Nov 30 21:03:02 CET 2001

print int.__doc__

int(x[, base]) -> integer

Convert a string or number to an integer, if possible.  A floating point
argument will be truncated towards zero (this does not include a string
representation of a floating point number!)  When converting a string, 
use the optional base.  It is an error to supply a base when converting 
a non-string.


The second argument tells python of what base the string argument is.

More information about the Python-list mailing list