All problems
MediumOOP
__repr__ method
Make `Point(x, y)` print as "Point(3, 4)" via __repr__.
- #dunder
- #repr
Sample input
Point(3, 4)
Sample output
Point(3, 4)
class-repr.py
Output
Press "Run code" to execute.
Loading…
Make `Point(x, y)` print as "Point(3, 4)" via __repr__.
Point(3, 4)
Point(3, 4)
Press "Run code" to execute.