KnowledgeBoat Logo

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