Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Vector:
- def __init__(self, x, y):
- self.x = x
- self.y = y
- def add(vectorOne, vectorTwo):
- x = vectorOne.x + vectorTwo.x
- y = vectorOne.y + vectorTwo.y
- return Vector(x,y)
- v1 = Vector(1,1)
- v2 = Vector(2,2)
- v3 = add(v1,v2)
- print(v3.x,v3.y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement