Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Converting Binary to Integer
B = '1101'
I = 0
while B != '':
I = I * 2 + (ord(B[0]) - ord('0'))
B = B[1:]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.