title: Is there a way I can make a list out of this?
body: <p>So I programmed this code to print out how many times a number would be printed in the list that I provided, and the output works, but I want to put all the values that I get into a list, how can I do that?
  This is my code...</p>
  <pre><code>i = [5,5,7,9,9,9,9,9,8,8]
  def num_list(i):
      return [(i.count(x),x) for x in set(i)]
  
  for tv in num_list(i):
      if tv[1] &gt; 1:
          print(tv)
  </code></pre>
  <p>The output that I get is</p>
  <pre><code>(2, 8)
  (5, 9)
  (2, 5)
  (1, 7)
  </code></pre>
  <p>but I want the output to be like</p>
  <pre><code>[2,8,5,9,2,5,1,7)
  </code></pre>
  <p>How can I do that??</p>