Accessing an element in tuple in a dictionary Python
<p>I'm writing a code to identify the subfix for a given number. I have a bunch of <code>if</code> statements to figure out the subfix. However I thought that a more elegant solution would be a dictionary. So I have the below dictionary:</p>

<p>The issue is, if I write <code>9 in subfix</code>, the result is False. How do I access the elements in the tuple in the dictionary?</p>

<pre><code> subfix = {(0, 4, 5, 6, 7, 8, 9, 11, 12, 13): 'th', 1: 'st', 2: 'nd', 3: 'rd'}
</code></pre>

<p>For example, I would like to write something simple like:</p>

<pre><code>def subf(a):
     if a in subfix:
           ending = subfix.get(a)
     print('We met on the ',a,ending,'.'sep='')
</code></pre>

<p>which would print 'We met on the 1st.' (but doesn't work for 0,4,5,6,7,8,9,11,12,13) How do I get it to work for those elements?</p>
