Python -Identitätsoperatoren
Python-Identitätsoperatoren
Identitätsoperatoren werden verwendet, um die Objekte zu vergleichen, nicht wenn sie gleich sind, sondern wenn sie tatsächlich dasselbe Objekt mit demselben Speicherort sind:
Operator | Description | Example | Try it |
---|---|---|---|
is | Returns true if both variables are the same object | x is y | |
is not | Returns true if both variables are not the same object | x is not y |