Python -identiteitsoperators
Python-identiteitsoperators
Identiteitsoperators worden gebruikt om de objecten te vergelijken, niet als ze gelijk zijn, maar als ze daadwerkelijk hetzelfde object zijn, met dezelfde geheugenlocatie:
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 |