string to integer comparison in Python
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3270680/how-does-python-compare-string-and-int">How does Python compare string and int?</a>  </p>
</blockquote>



<p>I was doing some comparison in Python. I was surprised to see that I can compare a string to an integer. then I did an id and found out that actually id for string is greater than id for int and i thought that's the reason I am getting this output.</p>

<pre><code>In [19]: 'a' &lt; 3
Out[19]: False

In [20]: 'a'&gt;3
Out[20]: True

In [17]: id('a')
Out[17]: 140414909035824

In [18]: id(3)
Out[18]: 23119752
</code></pre>

<p>Please confirm that I am interpreting this behavior correctly (Python comparing on id level).</p>
