( == ) and Is Operator in Python
( == ) Double equal to operator
The double equal operator compares the values of both the operands and checks for value equality.
Example #1:-
Output :-
is operator
is operator checks whether both operands refer to the same object or not means both refers to same memory location or not.
It check only both variables refer to same memory location.\
Example #2 :-
Output :-
It return False because the value of the variables are same but the memory location of both variables are different.
I hope you understand the concept of ( == ) and is operator in python. If you have any query or suggestion please do a comment.
Thank you.
Comments
Post a Comment