I just quote from the link, is checks if the operands are the same, possibly referring to the same object. where != checks the value.
s = [1,2,3] while s is not []: s.pop(0);
this is an undefined loop, because the object s is never equal to the reference to the object [], this refers to a completely different object. where, replacing the condition with s != [] , make the loop defined, because here we compare the values ββwhen all the values ββfrom s crowd out what remains, this is an empty list.
saikumarm
source share