Operatory tożsamości Pythona
Operatory tożsamości Pythona
Operatory tożsamości są używane do porównywania obiektów, nie jeśli są równe, ale jeśli w rzeczywistości są tym samym obiektem, z tą samą lokalizacją w pamięci:
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 |