Apr-16-2019, 06:32 PM
If x is a binary number as a string
int(x, 2)
will return an integer with the correct value.>>> b = '1101' >>> int(b) 1101 >>> int(b, 2) 13
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures