title: Closest pair of point by brute force
body: <p>I do not know what is wrong with my code. I generate 100 random points and I want to find the closest pair of these points, but the result is wrong.</p>
  
  <pre><code>#Closest pair
  from math import sqrt
  from random import randint
  
  arr1=[]
  
  dist=0
  p1=[]
  p2=[]
  min1=1000
  for i in range(0, 100):
      arr1.append([randint(0,100),randint(0,100)])
  
  print(arr1)
  print("\n")
  
  def dist(a,b):
      x=pow((a[0]-b[0]),2)
      y=pow((a[1]-b[1]),2)
      return sqrt(x+y)
  
  for i in range(0, len(arr1)):
      for j in range(i+1, len(arr1)):
      dis=dist(arr1[i],arr1[j])
      if(dis&lt;min1):
          min1=dis
          p1=arr1[i]
          p2=arr1[j+1]
  
  print(p1,"",p2,min1)
  #print (sorted(arr1))
  </code></pre>