Tell us what’s happening:
how the hell am i not following the instructions above ive done it ive done the inheritance bs no? l
Your code so far
class R2Vector:
def __init__(self, x, y):
self.x = x
self.y = y
def norm(self):
return (self.x**2 + self.y**2)**0.5
def __str__(self):
return f'{self.x, self.y}'
# User Editable Region
class R3Vector(R2Vector):
pass
R3Vector().norm().__str__()
# User Editable Region
v1 = R2Vector(2, 3)
print(v1.norm())
print(v1)
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Challenge Information:
Learn Special Methods by Building a Vector Space - Step 12