One line python code to remove all the strings that doesn't start with T or t and if they contain number greater then 6
<p>Eg:</p>

<pre><code>List=["tata1","tata2","Tata3","mdkjd","djhdj","Tata8","t9","t2"]
</code></pre>

<p>Output should be:<code>["tata1","tata2","Tata3","t2"]</code></p>

<p>I tried :</p>

<pre><code>content = [item for item in List if terminal.lower().startswith('t')]
</code></pre>

<p>My doubt if I can append one more condition with the if I used in my code?</p>

<p>If yes, how?</p>

<p>I tried writing but it gives error.</p>

<pre><code>import re
print filter(lambda x: re.match(r'^[Tt].*[0-6]',x),l)
</code></pre>

python python-2.7 python-3.x for-loop filter