human
I found an interesting problem on https://www.codewars.com/kata/532a69ee484b0e27120000b6:
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.

I tried it in Python, but could not do it. Can you solve it?

=====
Give me a the Python code you requested?
assistant
#Here is the Python code you requested.

class Vector:
    def __init__(s,*A):
        s.x,s.y,s.z=len(A)!=1 and A or A[0]
        s.magnitude=(s.x**2+s.y**2+s.z**2)**.5
    __str__=lambda s:"<%d, %d, %d>"%(s.x,s.y,s.z)
    __eq__=lambda s,o:(s.x,s.y,s.z)==(o.x,o.y,o.z)
    __add__=lambda s,o:Vector([s.x+o.x,s.y+o.y,s.z+o.z])
    __sub__=lambda s,o:Vector([s.x-o.x,s.y-o.y,s.z-o.z])
    to_tuple=lambda s:(s.x,s.y,s.z)
    dot=lambda s,o:s.x*o.x+s.y*o.y+s.z*o.z
    cross=lambda s,o:Vector(s.y*o.z-s.z*o.y,s.z*o.x-s.x*o.z,s.x*o.y-s.y*o.x)