converting string into binary integer in Python
<p>I'm trying to convert a string into a binary integer:</p>

<pre><code>string = "0b011" 
i = int(string)
</code></pre>

<p>But this code raises a <code>ValueError</code>. However, the following code works fine:</p>

<pre><code>i = int(0b011)
</code></pre>

<p>But here I've passed a binary literal, not a string. How do I convert a string?</p>
