title: Only the last result of a for-loop iteration is being saved in a dictionary
body: <p>I am very new to Python and I am currently trying to store results from a for-loop in a dictionary. I am aiming to get &quot;ratios&quot; as keys and &quot;frequency&quot; as values. I want to iterate through a list of unique ratios and count them in a dictionary called <code>comparison_dict</code>. I have done that part and to do it I first created a type list from the <code>comparison_dict</code> values (<code>list_orig_ratios</code>).</p>
  <pre><code>frequencies = dict()
  sorted_unique_ratios = sorted(unique_ratios)
  
  list_orig_ratios = list(comparison_dict.values())
  for ratio in sorted_unique_ratios:
      freq = list_orig_ratios.count(ratio)
      frequencies = {ratio:freq}
      print(frequencies)
  </code></pre>
  <p>When I add the print command at the end of my for-loop I can see all pairs of ratios and their counts but each of them is a separate dictionary. I would like to have them all as a single dictionary, with ratios as keys and frequencies (counts) as values. If I run the print command outside of the loop I see that only the last key:value pair is saved there.</p>
  <p>How can I store the results of this for-loop in a single dictionary?</p>