title: Python- cannot get a list of values in for loop when there are numbers in json structures
body: <p>I was trying to to get all the types inside a colours-&gt;numbers but it doesn't work because the colours e.g. green,blue inside an integer so i could not go through a loop to get them.</p>
  <p>Here is the code that I was trying to do:</p>
  <pre><code>x=0
  for colour in colours['rootdata']: 
      
      print(colour[x][type])
      x+1
  
  
  </code></pre>
  <p>but is shows 'string indices must be integers'</p>
  <p>I'm able to get a single value with for loop like this :(but this not what i want)</p>
  <pre><code>colour_red = JsonResult['rootdata']['colours']['0']['type']
  print (colour_red )
  </code></pre>
  <p>This is the simple json sample that I'm using</p>
  <pre><code>{
      &quot;rootdata&quot;: {
  
  
          &quot;colours&quot;: {
              &quot;0&quot;: {
                  &quot;type&quot;: &quot;red&quot;
  
              },
              &quot;1&quot;: {
                  &quot;type&quot;: &quot;green&quot;
  
              },
              &quot;2&quot;: {
                  &quot;type&quot;: &quot;blue&quot;
  
              }
  
          }
      }
  }
  
  </code></pre>