operator overloading #564
sathyarajsp09-blip
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was learning operator overloading method of OOPS the idea to perform add, multi,substract and I dont clearly understand why we use Vector2D under add method while returning the values though AI gave me some clarification that it is a instance needed to print value for the output of
v3 = v1 + v2
print(v3)
print(v3.x)
class Vector2D:
def init(self, x, y):
self.x = x
self.y = y
Beta Was this translation helpful? Give feedback.
All reactions