Image

Anyone Can Code.





Image


Identity Operators



Avi Bhattacharya



Identity operators are used to check whether two objects are identical.

There are two identity operators: is and is not. It's pretty self-explanatory what these two do. is checks whether two objects are identitcal while is not checks whether two objects are not the same.


    x = 6
    y = 5
    print(x is not y)
    y = 6
    print(x is y)
                                          
True True


That's it for this tutorial! Click Next to access the next tutorial!

❮ Back

Next ❯









Copyright © 2020, Q-Programming | Created by Arjun Sodhi, Balpreet Juneja and Sammarth Kumar | Developed and Designed by Sammarth Kumar