Extract random values from list that fulfil criteria? Python
<p>Is it possible to use the random module to extract strings from a list, but only if the string has a length greater than x?</p>

<p>For example:</p>

<pre><code>list_of_strings = ['Hello', 'Hello1' 'Hello2']
</code></pre>

<p>If you set <code>x = 5</code> and call <code>random.choice()</code> the code would be 'choosing' between only <code>list_of_strings[1]</code> and <code>list_of_strings[2]</code>.</p>

<p>I realise you could make a second list which contains only values of <code>len &gt; x</code> but i would like to know if it is possible without this step.</p>