Find a specific word from a list in python
<p>So I have a list like below-</p>

<pre><code>list = [scaler-1, scaler-2, scaler-3, backend-1, backend-2, backend-3]
</code></pre>

<p>I want to create another list from it with the words which starts with 'backend'.How can i do that ?</p>

<p>Please note the content of the list will change from system to system, I want my code to be dynamic, any help?</p>

<p>First off, do not use the name <code>list</code> for assignment to your objects, you'll shadow the builtin list type.</p>

<p>Then, you can use a <em>list comprehension</em> with <a href="https://docs.python.org/2/library/stdtypes.html#str.startswith" rel="nofollow"><code>str.startswith</code></a> in a filter:</p>

<pre><code>new_lst = [x for x in lst if x.startswith('backend')]
</code></pre>

python