I need to take a list I have created and find the closest two points and print them out. How can I go about comparing each point in the list?
There isn\'t any need to pl
Note that the math.sqrt function is both slow and, in this case, unnecessary. Try comparing the distance squared to speed it up (sorting distances vs. distance squared will always produce the same ordering):
math.sqrt
def distSquared(p0, p1): return (p0[0] - p1[0])**2 + (p0[1] - p1[1])**2