# 0609.py class vettore: def __init__(A,x,y,z): A.x=float(x); A.y=float(y); A.z=float(z) def __add__(A,B): return vettore(A.x+B.x,A.y+B.y,A.z+B.z) def __mul__(A,t): return vettore(A.x*t,A.y*t,A.z*t) def __rmul__(A,t): return A*t def coeff(A): return [A.x,A.y,A.z] def __mod__ (A,B): return A.x*B.x+A.y*B.y+A.z*B.z def __and__ (A,B): (x,y,z)=A.coeff(); (u,v,w)=B.coeff() return vettore(y*w-z*v,z*u-x*w,x*v-y*u) def __str__ (A): return '%.2f %.2f %.2f' %(A.x,A.y,A.z) a=vettore(2,3,5); b=vettore(1,7,2) print (a&b) # -29.00 1.00 11.00