One of the little things I love about Python is that you can chain comparison operators like this:
10 <= x <= 20
or
x == y == z
Strangely, I hadn't realized until yesterday that this also works with the
is
operator:
x is y is z
One of the little things I love about Python is that you can chain comparison operators like this:
10 <= x <= 20
or
x == y == z
Strangely, I hadn't realized until yesterday that this also works with the
is
operator:
x is y is z