Create a class Vector that has simple (3D) vector operators.
In your class, you should support the following operations, given Vector ```a``` and Vector ```b```:
```python
a + b # returns a new Vector that is the resultant of adding them
a - b # same, but with subtraction
a == b # returns true if they have the same magnitude and direction
a.cross(b) # returns a new Vector that is the cross product of a and b
a.dot(b) # returns a number that is the dot product of a and b
a.to_tuple() # returns a tuple representation of the vector.
str(a) # returns a string representation of the vector in the form ""
a.magnitude # returns a number that is the magnitude (geometric length) of vector a.
a.x # gets x component
a.y # gets y component
a.z # gets z component
Vector([a,b,c]) # creates a new Vector from the supplied 3D array.
Vector(a,b,c) # same as above
```
The test cases will not mutate the produced Vector objects, so don't worry about that.
import math
import operator


class Vector:
    def __init__(self, *args):
        self.x, self.y, self.z = self.args = tuple(args[0] if len(args) == 1 else args)
        self.magnitude = math.sqrt(sum(i ** 2 for i in self.args))

    def __str__(self):
        return '<{}>'.format(', '.join(map(str, self.args)))

    def __eq__(self, other):
        return self.args == other.args

    def __add__(self, other):
        return Vector(*map(operator.add, self.args, other.args))

    def __sub__(self, other):
        return Vector(*map(operator.sub, self.args, other.args))

    def dot(self, other):
        return sum(map(operator.mul, self.args, other.args))

    def to_tuple(self):
        return self.args

    def cross(self, other):
        return Vector(
            self.y * other.z - self.z * other.y,
            self.z * other.x - self.x * other.z,
            self.x * other.y - self.y * other.x,
        )
import math
import operator


class Vector:
    def __init__(self, *args):
        self.x, self.y, self.z = self.args = tuple(args[0] if len(args) == 1 else args)
        self.magnitude = math.sqrt(sum(i ** 2 for i in self.args))

    def __str__(self):
        return '<{}>'.format(', '.join(map(str, self.args)))

    def __eq__(self, other):
        return self.args == other.args

    def __add__(self, other):
        return Vector(*map(operator.add, self.args, other.args))

    def __sub__(self, other):
        return Vector(*map(operator.sub, self.args, other.args))

    def dot(self, other):
        return sum(map(operator.mul, self.args, other.args))

    def to_tuple(self):
        return self.args

    def cross(self, other):
        return Vector(
            self.y * other.z - self.z * other.y,
            self.z * other.x - self.x * other.z,
            self.x * other.y - self.y * other.x,
        )