I am getting:
TypeError: len() of unsized object
after running the following script:
from numpy import *
v=array(input('Introduce un vector v: '))
u=array(input('Introduce un vector u: '))
nv= len(v)
nu= len(u)
diferenza= 0; i=0
if nv==nu:
while i<nv:
diferenza=diferenza + ((v[i+1]-u[i+1]))**2
modulo= sqrt(diferenza)
print('Distancia', v)
else:
print('Vectores de diferente dimensión')
How can I fix this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…