Re: Function to remove elements from a list working, but Python Hangs :((

2006-06-12 Thread Steve Holden
Girish Sahani wrote: >>I guess it's already the case with lst = [ e for e in lst if e in pairs ] >> >> >>In [1]: lst = (1,2,3,4) >> >>In [2]: pairs=(5,) >> >>In [3]: lst=[e for e in lst if e in pairs] >> >>In [4]: lst >>Out[4]: [] > > Yes its working. I realized that i was giving an input which di

Re: Function to remove elements from a list working, but python hangs :((

2006-06-12 Thread bruno at modulix
Girish Sahani wrote: (please don't top-post) > Hey Bruno...you are seeing the wrong post :P...please ignore this and > check out the one with (corrected) appended at the end... You should have posted the correction in the same thread. > Also, i used the list comprehension thingy which u have gi

Re: Function to remove elements from a list working, but Python Hangs :((

2006-06-12 Thread Girish Sahani
> I guess it's already the case with lst = [ e for e in lst if e in pairs ] > > > In [1]: lst = (1,2,3,4) > > In [2]: pairs=(5,) > > In [3]: lst=[e for e in lst if e in pairs] > > In [4]: lst > Out[4]: [] Yes its working. I realized that i was giving an input which didnt satisfy the condition. Now

Re: Function to remove elements from a list working, but python hangs :((

2006-06-12 Thread Girish Sahani
Hey Bruno...you are seeing the wrong post :P...please ignore this and check out the one with (corrected) appended at the end... Also, i used the list comprehension thingy which u have given, but now the problem is python just hangs if my list l4 contains around 50 pairs...considering its not that b