title: How can I match list elements with tuple elements?
body: <p>I have the following lists and tuple lists:</p>
  <pre class="lang-py prettyprint-override"><code>adsh_list_sub
  ['0000007084-22-000008', '0000766421-22-000009', '0000320193-22-000007']
  </code></pre>
  <pre class="lang-py prettyprint-override"><code>cik_list
  ['7084', '766421', '320193']
  </code></pre>
  <pre class="lang-py prettyprint-override"><code>adsh_cik_tuple
  [('0000007084-22-000008', '7084'),
   ('0000766421-22-000009', '766421'),
   ('0000320193-22-000007', '320193')]
  </code></pre>
  <pre class="lang-py prettyprint-override"><code>adsh_list_num
  ['0000007084-22-000008',
   '0000007084-22-000008',
   '0000320193-22-000007',
   '0000320193-22-000007',
   '0000766421-22-000009',
   '0000766421-22-000009',
   '0000320193-22-000007',
   '0000320193-22-000007',
   '0000007084-22-000008',
   '0000007084-22-000008',
   '0000007084-22-000008',
   '0000007084-22-000008',
   '0000007084-22-000008',
   '0000007084-22-000008',
   '0000320193-22-000007',
   '0000320193-22-000007',
   '0000007084-22-000008']
  </code></pre>
  <p>Note that <br> (1) all elements in 'adsh_list_num' are elements of 'adsh_list_sub' <br>(2) all elements in 'adsh_list_num' are paired to a cik element through 'adsh_cik_tuple'</p>
  <p><em>How can I generate a new list 'cik_num' such that 'cik_num' is identical to 'adsh_list_num' except that it contains not the adsh element but the cik element from 'adsh_cik_tuple'?</em></p>
  <p>(In this example, the string of the cik element need not always be contained in the 'adsh' element.)</p>
  <p>Expected output:</p>
  <pre class="lang-py prettyprint-override"><code>['7084',
   '7084',
   '320193',
   '320193',
   '766421',
   '766421',
   '320193',
   '320193',
   '7084',
   '7084',
   '7084',
   '7084',
   '7084',
   '7084',
   '320193',
   '320193',
   '7084']
  </code></pre>