Python filter() function and list comparison : <p>I have a list in python like <code>l=('A','1,''B','2','C','3,''D','4')</code> and i need to filter out the value of A,B,C,D so i wrote a code like follow</p>

<pre><code>list(filter(lambda x:x.isalpha(),l))
</code></pre>

<p>then returned <code>['A', 'C']</code></p>

<p>it did't return value B and D so i thought it was some thing i don't know about python filter function then i wrote it in list comparison like follows</p>

<pre><code>[i for i in l if i.isalpha()]
</code></pre>

<p>but the strange thing is it also return the <code>['A', 'C']</code> so every time what happen to the value B and  D </p>

<p>Any one can explain me how to filter all alphabetic values out ???</p>
