I would like to know something in python. I'm searching to compare an array with 20 elements. I want calculate the distance between the first word of my array with the 2nd and the 1st word with the 3rd and the first word with the 4th ... into 20th. For the moment I got it. But I want do more and compare the 2nd element with 3th and 2nd element with 4th and 2nd with 5th, and after the 3th with 4th and the 3th with 5th and 3th with 6th......
This is my code for the moment:
x=0
valeur = []
valdate = []
req = "select * from film"
result = cur.execute(req)
print(type(result))
for row in result:
#print(row[1])
#print(row[2])
valeur.append(row[1])
valdate.append(row[2])
for i in range(x,len(valeur)-1):
ed = nltk.edit_distance(valeur[0], valeur[i])
resultat=(valeur[x], " &&" ,valeur[i], "&&" ,ed)
x=x+1
print(resultat)