Computer Science
Is it true that if two objects return True for is operator, they will also return True for == operator?
Python Data Handling
33 Likes
Answer
Yes, if is operator returns true, it implicitly means that the equality operator will also return True. is operator returning true implies that both the variables point to the same object and hence == operator must return True.
Answered By
21 Likes
Related Questions
Are these values equal? Why/why not?
- 20 and 20.0
- 20 and int(20)
- str(20) and str(20.0)
- 'a' and "a"
What are Immutable and Mutable types in Python? List immutable and mutable types of Python.
What are three internal key-attributes of a value-variable in Python ? Explain with example.
What is an atom in Python? What is an expression?