title: How to add count for each unique val in list
body: <p>Assume I have a list.</p>
  
  <pre><code>temp = ['A', 'B', 'A', 'B', 'A', 'B']
  </code></pre>
  
  <p>I am looking for a way to join the count of the string inside.</p>
  
  <p>Intended Output:</p>
  
  <pre><code>['A_1', 'B_1', 'A_2', 'B_2', 'A_3', 'B_3']
  </code></pre>
  
  <p>I was able to solve it by using a list comprehension but I am looking for a way where I don't have to specify the list <code>[1, 1, 2, 2, 3, 3]</code>. Is it possible?</p>
  
  <pre><code>[j + "_" + str(i) for i, j in zip([1, 1, 2, 2, 3, 3], temp)]
  </code></pre>