| 1 | class Vector: |
| 2 | def __init__(self, x, y, z): |
| 3 | self.x = x |
| 4 | self.y = y |
| 5 | self.z = z |
| 6 | |
| 7 | def __add__(self, other): |
| 8 | result = Vector(self.x + other.x, self.y + other.y, self.z + other.z) |
| 9 | return result |
| 10 | |
| 11 | def __mul__(self, other): |
| 12 | result = self.x * other.x + self.y * other.y + self.z * other.z |
| 13 | return result |
| 14 | |
| 15 | def __str__(self): |
| 16 | return f"Vector({self.x}, {self.y}, {self.z})" |
| 17 | |
| 18 | # Test the implementation |
| 19 | v1 = Vector(1, 2, 3) |
no outgoing calls
no test coverage detected