Shares
email sharing button Email
facebook sharing button Share
twitter sharing button Tweet
linkedin sharing button Share
print sharing button Print
whatsapp sharing button Share
reddit sharing button Share
blogger sharing button Share
arrow_left sharing button
arrow_right sharing button
 Krivalar Tutorials 
Krivalar Tutorials

Python - Identity Operators



<Bitwise Operators    Membership Operators >









Identity operators are used to checking if two operands or objects are the same.

Python supports two identity operators.

OperatorsMeaning
is This operator returns True only if both variables or operands
refer to the same object otherwise returns False.
is not This operator returns True only if both variables or operands
are not the same object Otherwise returns False.

To get the identity of an object, we can use the id() function.

Python Identity Operators Example

>> x=10
>> y=10
>> z='welcome'
>> print(x is y)
True
>> print(x is z)
False
>> print(x is not z)
True
>> print(y is not z)
True
>> print(y is x)
True

<Bitwise Operators    Membership Operators >























Searching using Binary Search Tree