title: Accessing y-coordinates in a list of tuples
body: <p>I have a list of pairs where the list resembles li = [(a,b), (c,d), ... , (t, u)]. I am attempting to index into the y-coordinates of each tuple to count how many tuples have a y-coordinate of 0, 1, or 2 but am unsure of how to do so. Calling li[i] only returns (a,b) but not the specific coordinate (b) I want. I have searched similar questions, so I was able to get a bit of the list comprehension but am still not able to process the loop. My code currently looks like this:</p>
  
  <pre><code>for i in range(len(li)):
      if (x,y) for x, y in li if y == 0:
          zero_count += 1
      elif (x,y) for x, y in li if y == 1:
          one_count += 1
      # if y-coordinate = 2
      else:
          two_count += 1   
  </code></pre>