Hello again! I'm currently working on my next wii remote mouse script, one that negates the roll of the wiimote, and I've found that thinking of the accelerations in terms of vectors work out really well. For example, the acceleration vector is set up as the following:

**Code:**

accl = [wiimote[0].acceleration.x, wiimote[0].acceleration.y, wiimote[0].acceleration.z]

The problem is, I need a function that takes in a vector (list of 3 numbers/variables), and spits out another vector, in the same form of a list of 3 numbers/variables, like this:

**Code:**

def unitVect(v):

if math.sqrt(sum(n**2 for n in v)) != 0:

return v/(math.sqrt(sum(n**2 for n in v)))

else:

return 0

Which, (in theory,) if given a vector v = [x,y,z], should spit out a different vector unitVect(v) = [a,b,c]

I know this code doesn't work because v here is a list and not a number, but is there a way to treat lists like this in python?