title: Program to count distance between coordinates
body: <p>In this program I parse json data which contains key-'id' and value-'coord' to python dictionary. I am new in python, so sorry that code is not pythonic-way). My problem is in line z = myDict.get(n). It returns me always the same value, but I'd like to have it change by 1 next key every 49 iterations(because I do have 49 coordinates) Here is my json looks like:</p>
  
  <pre><code> {"status" : "200", 
      "result" : [{"id":10001,"coord":"45.781231 78.784321"},{"id":10002,"coord":"45.481684 78.743410},{"id":10003,"coord":"45.411934 78.543113}, etc the same 50 dicts.
  </code></pre>
  
  <p>Would be very thankful if you help me. </p>
  
  <pre><code>from math import sin, cos, sqrt, atan2, radians
  import requests 
  import itertools 
  
  
  def data():
      response = requests.get('')
      json_data = response.json()
      global myDict
      myDict = {}
      for each in json_data['result']:
      myDict.update ({each['id']: (each['coord'])})
  
  
      myDict[10252] = '43.238454 76.949185'
      myDict = {str(k):(v) for k,v in myDict.items()}
      keys, values = zip(*myDict.items())
      for v in itertools.product(*values):
          experiment = dict(zip(keys, v))    
          for key,value in experiment.items():
          x = myDict[key]
          for n,m in experiment.items():
              z = myDict.get(n)
          var1,var2 = x.split()
          var3,var4 = z.split()                                                                                                   
          R = 6373.0 
          lat1 = radians(float(var1)),radians(float(var2))
          lat2 = radians(float(var3)),radians(float(var4))
          dlon = lat2[1]-lat1[1]
          dlat = lat2[0]-lat1[0]
          a = sin(dlat / 2)**2 + cos(lat1[0]) * cos(lat2[0]) * sin(dlon / 2)**2
          c = 2 * atan2(sqrt(a), sqrt(1 - a))
          distance = int((R * c)*1000)
          print ("Result:", distance)
          print(x,z)
   g = data()
   print(g)
  </code></pre>
  
  <p>My given output is:
  As you can see numbers are equal every 49 iterations. It compares every "id" value with only "id":10001. And I want it to compare with "id": 10002, 10003, 10004 etc..  </p>
  
  <pre><code>Result: 0
  Result: 55
  Result: 1987
  Result: 1345
  Result: 3290
  Result: 4380
  Result: 2058
  Result: 4715
  Result: 910
  Result: 2501
  Result: 1176
  Result: 3958
  Result: 3622
  Result: 534
  Result: 1176
  Result: 922
  Result: 2154
  Result: 3440
  Result: 2749
  Result: 1530
  Result: 2139
  Result: 919
  Result: 1264
  Result: 3331
  Result: 1559
  Result: 3542
  Result: 3752
  Result: 4684
  Result: 3262
  Result: 5653
  Result: 6239
  Result: 5827
  Result: 6245
  Result: 1444
  Result: 754
  Result: 1755
  Result: 453
  Result: 5459
  Result: 7287
  Result: 1642
  Result: 4506
  Result: 4266
  Result: 493
  Result: 1029
  Result: 4944
  Result: 4744
  Result: 5206
  Result: 2683
  Result: 0
  Result: 55
  Result: 1987
  Result: 1345
  Result: 3290
  Result: 4380
  Result: 2058
  Result: 4715
  Result: 910
  Result: 2501
  Result: 1176
  Result: 3958
  Result: 3622
  Result: 534
  Result: 1176
  Result: 922
  Result: 2154
  Result: 3440
  Result: 2749
  Result: 1530
  Result: 2139
  Result: 919
  Result: 1264
  Result: 3331
  Result: 1559
  Result: 3542
  Result: 3752
  Result: 4684
  Result: 3262
  Result: 5653
  Result: 6239
  Result: 5827
  Result: 6245
  Result: 1444
  Result: 754
  Result: 1755
  Result: 453
  Result: 5459
  Result: 7287
  Result: 1642
  Result: 4506
  Result: 4266
  Result: 493
  Result: 1029
  Result: 4944
  Result: 4744
  Result: 5206
  Result: 2683
  Result: 0
  Result: 55
  Result: 1987
  Result: 1345
  Result: 3290
  Result: 4380
  Result: 2058
  Result: 4715
  Result: 910
  Result: 2501
  Result: 1176
  Result: 3958
  Result: 3622
  Result: 534
  Result: 1176
  Result: 922
  Result: 2154
  Result: 3440
  Result: 2749
  Result: 1530
  Result: 2139
  Result: 919
  Result: 1264
  Result: 3331
  Result: 1559
  Result: 3542
  Result: 3752
  Result: 4684
  Result: 3262
  Result: 5653
  Result: 6239
  Result: 5827
  Result: 6245
  Result: 1444
  Result: 754
  Result: 1755
  Result: 453
  Result: 5459
  Result: 7287
  Result: 1642
  Result: 4506
  Result: 4266
  Result: 493
  Result: 1029
  Result: 4944
  Result: 4744
  Result: 5206
  Result: 2683
  </code></pre>