Q. Two objects (say a and b) when compared using ==, return True. But Python gives False when compared using is operator. Why


(i.e, a == b is True but why is a is b False ?)

Answer = 

Because python assign different memory address to a and b even if their exists a same value .

 

You can uderstand by watching videos -----




Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post