、2グループの文字列を比較しますか?は、私はPythonのコンソールでこの<a href="https://i.stack.imgur.com/fojMC.png" rel="nofollow noreferrer">command</a>を実行して異なる結果を返す
>>>S1 = 'HelloWorld'
>>>S2 = 'HelloWorld'
>>>S1 is S2
True
>>>S1 = 'Hello World'
>>>S2 = 'Hello World'
>>>S1 is S2
False ---------i think the result is True,why it is False
これは一般的な動作です。次のスレッドを参照してください:[アイデンティティテストと平等テスト](http://stackoverflow.com/questions/1504717/why-does-comparing-strings-in-python-using-either-or-is-sometimes-produce) –
特に、重複から[この回答](http://stackoverflow.com/a/1504848/5014455)を参照してください。 –
** pycharmでコードを実行している間、**両方の場合にtrueを返します –