All problems
MediumOOP
__eq__ — equality
Make `Point` instances equal if both x and y match.
- #dunder
- #eq
Sample input
Point(1,2) == Point(1,2)
Sample output
True
class-eq.py
Output
Press "Run code" to execute.
Loading…
Make `Point` instances equal if both x and y match.
Point(1,2) == Point(1,2)
True
Press "Run code" to execute.