Python3
Tue, Jan 1, 2019

When making comparisons of variables you can use both == and is, although they do not work in the same way. In general, we have:

  • You use == to compare values. It is used when you want to know if two variables have the same value.
  • You use is to compare objects. It is used when you want to know if two variables (literally) refer to the same object.

For example: