title: how to extract data in dict and the print it out line by line?
body: <p>I have a dict and need to extract the value, group it according to same key and print it. My problem is i dont know how to loop inside the dict and group it.</p>
  <pre><code>dicts=[{0: 'ATO'}, {1: 'CC'}, {1: 'CD'}, {2: 'GYU'}, {2: 'JOI'}, {3: 'AFD'}]
  data =[value for line in dicts for key, value in line.items() if key == 0]
  for t in data:
      print(t)
  </code></pre>
  <p>my output is</p>
  <pre><code>ATO
  </code></pre>
  <p>my expected output is</p>
  <pre><code>ATO
  CC, CD
  GYU, JOI
  AFD
  </code></pre>