When we have two variable names that point to the same value,
things can start to get confusing.
It's actually not too bad when we point to immutable objects.
So for example, we have the variable a,
pointing to banana and we've got b,
also pointing to banana.
Now, it turns out that with strings,
the Python interpreter figures out that
it's the same string banana and it makes a and b both point to it.
So we have this operator is,
which checks and tells us whether a and b are pointing to the same object,
are they aliases for the same object?
Here it says, "True",
a and b are pointing to the same object.
It's going to get a little more complicated for us when
we start dealing with lists and other mutable objects.
Here, we've got variables a and b,
both pointing to lists that have equivalent values,
but it turns out they aren't actually aliases for each other.
Let's see this in codelens.
So, the variable a, is bound to a list of three items 81, 82 and 83.
Then we're going to assign b,
to a list that's really equivalent,
but it isn't the same list.
So, we end up with two lists that each have the values 81,
82 and 83, and then a is not an alias for b.
So, when we print a as b,
it tells us, "False".
However, if we ask,
"Does a equal equal b?",
as we do on line six,
it will tell us, "True".
So, equal equal is an operator that checks whether
two variables are bound to objects that are equivalent to each other.
a is b checks whether a and b are aliases for exactly the same object.
If we print the IDs of these two,
we'll see that they are not the same.
So, those are very long IDs.
I just want to point out one other thing which is,
that if we run this not in codelens but in the activecode window,
we get the same answers false and true for whether a is b and whether a equal equals b,
but the ID numbers are a little different.
In codelens, the interpreter is running off on
some remote computer and it's got
a real Python interpreter where the ID numbers are really big.
When we run it in codelens,
it's doing something right in the browser,
it's the only thing running and so it ends up with these small ID numbers.
But the important thing to notice whether you run it in
the activecode window or whether you run it in codelens,
is that the two ID numbers are not the same.
Three and four are different or these two ID numbers are different.