Michael J. answered 06/08/19
Mathematics and Computer Programming for Gifted Students
In python 'is' compares the memory addresses to see if the values refer to the same object. Python tries to optimize memory usage and will often refer multiple variable names to the same location if they have the same value. This optimization can differ between execution of a script and use of the terminal. Because of this you should not use 'is' to compare the value of objects.
Whereas '==' compares the values in the objects. This is the operator to which you should default.