title: Comparing values in dictionaries python
body: <p>I have 2 nested dictionaries in Python that have this format:</p>
  
  <pre><code>1166869: {'probL2': '0.000', 'probL1': '0.000', 'pronNDiff_site': '1.000', 'StateBin': '0', 'chr': 'chrX', 'rangehist': '59254000-59255000', 'start_bin': '59254000', 'countL2': '4', 'countL1': '0'} 
  
  1166870: {'probL2': '0.148', 'probL1': '0.000', 'pronNDiff_site': '0.851', 'StateBin': '0', 'chr': 'chr2', 'rangehist': '59254000-59255000', 'start_bin': '59255000', 'countL2': '5', 'countL1': '15'} 
  
  1166871: {'probL2': '0.000', 'probL1': '0.000', 'pronNDiff_site': '1.000', 'StateBin': '0', 'chr': 'chrY', 'rangehist': '59290000-59291000', 'start_bin': '59290000', 'countL2': '1', 'countL1': '2'}
  </code></pre>
  
  <p>where 1166869, 1166870 and 1166871 represent a line in a file from where I read the data, and the rest of the keys are the data itself.</p>
  
  <p>Now I want to make a list where I store all the different values in the key "chr" because there are some repeated ones.</p>
  
  <p>How can I go through the dictionary and make the comparison between the 2 values? This code is not working:</p>
  
  <pre><code>for k in range(len(file_dict)):
      for j in range(len(file_dict)-1):
          if (file_dict[j]["chr"] != file_dict[k]["chr"]):
              list_chr.append(file_dict[j]["chr"])
  </code></pre>