What is wrong with int() function not accepting string in Python? : <p>I am relatively new to programming and I would like to test the base conversion ability of the int() function.
When I write:</p>

<pre><code>&gt;&gt;&gt; int("3",2)
11
</code></pre>

<p>it displays this. However, if I use:</p>

<pre><code>&gt;&gt;&gt; int('3',2)
</code></pre>

<p>it displays a value error, invalid literal for int with base 2: '3'
What is going on? This does not allow me to use int(str(a),2) for example.
I'm using Python 3.7.0 if this helps. I'm very frustrated with this problem.</p>
