title: How to retrieve partial matches from a list of strings
body: <p>For approaches to retrieving partial matches in a <em><strong>numeric</strong></em> list, go to:</p>
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/35101426/how-to-return-a-subset-of-a-list-that-matches-a-condition">How to return a subset of a list that matches a condition?</a></p>
  </li>
  <li><p><a href="https://stackoverflow.com/questions/9542738/python-find-in-list">Python: Find in list</a></p>
  </li>
  </ul>
  <hr />
  <p>But if you're looking for how to retrieve partial matches for a list of <em><strong>strings</strong></em>, you'll find the best approaches concisely explained in the answer below.</p>
  <p><a href="https://stackoverflow.com/questions/6117318/python-list-lookup-with-partial-match">SO: Python list lookup with partial match</a> shows how to return a <code>bool</code>, if a <code>list</code> contains an element that partially matches (e.g. <code>begins</code>, <code>ends</code>, or <code>contains</code>) a certain string. But how can you <em><strong>return the element itself</strong></em>, instead of <code>True</code> or <code>False</code></p>
  <h3>Example:</h3>
  <pre><code>l = ['ones', 'twos', 'threes']
  wanted = 'three'
  </code></pre>
  <p>Here, the approach in the linked question will return <code>True</code> using:</p>
  <pre><code>any(s.startswith(wanted) for s in l)
  </code></pre>
  <p>So how can you return the element <code>'threes'</code> instead?</p>