intermediate python lesson 4: Solution: Polymorphism
Solution
yt link
To solve this exercise, it's essential to use Python's "magic" double-underscore methods to make the Point class behave like an integer (can be added) or like a string (can be printed).
class Point:
def __init__(self, x=0, y=0):
...
philipdevblog.hashnode.dev1 min read