import os Z=[] sonad=[] nimisonad=set() tegusonad=set() for rida in open("sonaseosed.txt", encoding="utf-8"): m=rida.strip().split(",") Z.append([int(m[1]), int(m[2]), float(m[3]), int(m[4])]) for rida in open("sonaindeksid.txt", encoding="utf-8"): sonad.append(rida.strip().split(",")[1]) for rida in open("nimisonad.txt", encoding="utf-8"): nimisonad.add(rida.strip()) for rida in open("tegusonad.txt", encoding="utf-8"): tegusonad.add(rida.strip()) sisusonad=nimisonad.union(tegusonad) #sisusonad=tegusonad asukoht=[] def uuriPuu(indeks, sygavus=0): asukoht.append(str(indeks)) if indeks