Nov-15-2017, 04:21 PM
(This post was last modified: Nov-15-2017, 04:23 PM by antoniomancera.)
I'm trying to create a program that for two list xs and ys, return a list zs with only the element of ys that their distance of any element of xs be at least d.
def distance(a,b): y=sqrt((a.real-b.real)**2+(a.imag-b.imag)**2) return y def dist(xs,ys,d): zs=[] for i in range(0,len(xs)-1): for k in range(0,len(ys)-1): if distancia(xs[i],ys[k])<=d: zs=zs break else: zs=zs+[ys[i]] return zsBut it's wrong, and I don't know how to fixed it. Could you help me please?.
Thank you.