title: How can i access to my elements in my JSON in Python?
body: <p>I'm trying to parse an get value of my elements in my JSON.</p>
  <pre><code>import json
    
  f = open('links.json',)
    
  data = json.load(f)
    
  for i in data['jsonObject']['links']:
      for y in data['jsonObject']['coordonates']:
          if (i['take1'] == y):
            point1 = y
          if (i['take2'] == y):
              point2 = y
      print(point1['x'])
      print(point1['y'])
      print(point2['x'])
      print(point2['y'])
  
  
  f.close()
  </code></pre>
  <p>And my json is like this</p>
  <pre><code>{
      &quot;jsonObject&quot;: {
          &quot;coordonates&quot;: {
              &quot;id1&quot;: {
                  &quot;x&quot;: 100,
                  &quot;y&quot;: 60
              },
              &quot;id2&quot;: {
                  &quot;x&quot;: 50,
                  &quot;y&quot;: 100
              },
              &quot;id3&quot;: {
                  &quot;x&quot;: -100,
                  &quot;y&quot;: 20
              },
              &quot;id4&quot;: {
                  &quot;x&quot;: 30,
                  &quot;y&quot;: 10
              },
          },
          &quot;links&quot;: [
              {
                  &quot;take1&quot;: &quot;id4&quot;,
                  &quot;take2&quot;: &quot;id1&quot;,
              },
              {
                  &quot;take1&quot;: &quot;id4&quot;,
                  &quot;take2&quot;: &quot;id3&quot;,
              },
              {
                  &quot;take1&quot;: &quot;id3&quot;,
                  &quot;take2&quot;: &quot;id2&quot;,
              },
              {
                  &quot;take1&quot;: &quot;id2&quot;,
                  &quot;take2&quot;: &quot;id1&quot;,
              },
          ],
      },
  }
  </code></pre>
  <p>With my code, i want to go to &quot;links&quot;, get the two ids. When i have my two id, i'm going to &quot;coordonates&quot;. And now i want to get the &quot;x&quot; and &quot;y&quot; of the two id.
  But my problem is when i'm trying to access to the 'x' and 'y' i have</p>
  <pre><code>TypeError: string indices must be integers
  </code></pre>
  <p>And when i'm printing <code>print(y['x'])</code>, i have the same problem. I can't access to the y elements.</p>
  <p>Anyone have an idea of my mistake ? And how can i do to get my 'x' and 'y' ?.</p>