ValueError: invalid literal for int() with base 2 using Python 3
<p>I have created my own version of AES (baby version) everything is working correctly however.</p>

<p>Some binary numbers somehow pick up a 'b' within them example: b1b10101
I am not very clued up on how python works with binary conversions but when trying to convert to a decimal using: <code>pepee = int(pepe,2)</code>. It throws the error mentioned in the title when the string contains 'b'.</p>

<p>I found one other answer for this error on here, however the solution does not work for me. using 'format(pepe,'b')' throws an error for me. 
I suspect it was written for Python 2.</p>

<p>I need to know, how I can prevent these b's from occurring in my binary strings, or how I can convert them back to the original bit value.</p>

<p>Sample code:</p>

<pre><code>subList2 = ['b1', 'b1', '00', '00']
subStr = b1b10000

subStr = ''.join(subList2)
subDec = int(subStr,2)
</code></pre>

<p>Please note I did not intend these b's to appear in the string, they appear during runtime</p>