How does Python interpreter work in dynamic typing?
<p>I read this question, but it didn't give me a clear answer:
<a href="https://stackoverflow.com/questions/25363034/how-does-python-interpreter-look-for-types">How does Python interpreter look for types?</a></p>

<p>How does python interpreter know the type of a variable? I'm not looking how do get the type. I'm here looking at what happens behind the scene. In the example below, how does it associate the class int or string to my variable.</p>

<p>How does it know that is an int:</p>

<pre><code>&gt;&gt;&gt; i = 123
&gt;&gt;&gt; type(i) 
&lt;class 'int'&gt;
</code></pre>

<p>or that string:</p>

<pre><code>&gt;&gt;&gt; i = "123"
&gt;&gt;&gt; type(i)
&lt;class 'str'&gt;
</code></pre>