0

私はPythonを学び始めたばかりです。問題が発生しました。私の疑問を解消してください。

a='abc'
b='abc'
a==b                 #When I run this O/P is True. But, in C/C++ or Java it turns out to be False because the variables(a & b) refer to different memories.

a is b               #When I run this O/P is True. Ok understood , but.....

でもいつ

a=[1,2,3]
b=[1,2,3]
a==b                #The out put is True

a is b              #THe output is False

文字列とリストの場合、2 つの異なる出力の理由は何ですか?

4

0 に答える 0