title: Why does string equality not working in this Python code as expected?
body: <p><strong>Note:</strong> Before you go and downvote or close my question, or mark it a duplicate, let me assure you that I have looked a dozens and dozens of similar questions on SO and Googled but after more than an hour, I still haven't solved this problem. No other answer solved my problem.</p>
  
  <p><strong>Question</strong>
  I have this Python code:</p>
  
  <pre><code>text = ''
  text += '&lt;' + '/' + '&gt;'
  
  print text, '&lt;/&gt;'
  print repr(text), repr('&lt;/&gt;')
  
  if text is '&lt;/&gt;':
      print 'Equal'
  else:
      print 'Not equal!'
  </code></pre>
  
  <p>I simply want to compare two strings. For some reason, I need to concatenate characters to <code>text</code> one by one. I expected the if-statement to evaluate to <code>True</code> but it doesn't. And I am at a loss why!</p>
  
  <p>Here's the output:</p>
  
  <p><code>&lt;/&gt; &lt;/&gt;
  '&lt;/&gt;' '&lt;/&gt;'
  Not equal!</code></p>
  
  <p>I am new to Python, and am using Python 2.7. Can anybody help, please?</p>