I’m getting this error: AttributeError: ‘NoneType’ object has no attribute ‘draw’
Can anyone explain why I am seeing this error? Thanks.
My code is below:
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
@classmethod
def defaults(cls):
cls(1, 2)
def draw(self):
print(f"Point ({self.x}, {self.y})")
robert = Point.defaults()
robert.draw()