why memory address are not same for same values
<p>Consider below code</p>

<pre><code>a,b="hello","hello" 
print id(a),id(b)
</code></pre>

<p>output</p>

<blockquote>
  <p>28954752 28954752</p>
</blockquote>

<p>output will be same for char,string etc
but <strong>now consider a list</strong></p>

<pre><code>list1=[1,2,3,4]
list2=[1,2,3,4]
print id(list1),id(list2)
</code></pre>

<p>output</p>

<blockquote>
  <p>139706054367136 139706054368360</p>
</blockquote>

<p>we can see address is given is different in case of list/tuple/dict, <strong>if they are reference variables so why string gives same address for same values?</strong></p>