title: Python semicolon does make a difference
body: <p>Why does use of a colon make difference to the result? And what should be the correct result?</p>
  
  <pre><code># Not stored in a different location.
  &gt;&gt;&gt; id('123 4')== id('123 4')
  True
  
  # Also returns true
  &gt;&gt;&gt; x = '123 4'; y ='123 4'; id(x) == id(y)
  True
  </code></pre>
  
  <h1>But this same thing returns false.</h1>
  
  <pre><code>&gt;&gt;&gt; x = '123 4'
  &gt;&gt;&gt; y = '123 4'
  &gt;&gt;&gt; id(x) == id(y)
  False
  </code></pre>
  
  <h1>Same thing under function returns True</h1>
  
  <pre><code>&gt;&gt;&gt; def test():
  ...     x = '123 4';y='123 4'; print (id(x)==id(y))
  ...     a = '123 4'
  ...     b='123 4'
  ...     print (id(a)==id(b))
  ...
  &gt;&gt;&gt; test()
  True
  True
  </code></pre>