[google-appengine] Re: is it a bug of python 2.5?----remove elements from list in for cycle

2009-06-01 Thread 秦锋
a = set(a) a.discard(b) a = list(a) On 6月1日, 下午8时48分, DiveIntoGAE taogf1...@gmail.com wrote: a=[b,c,t,y,b,b,b,b] a ['b', 'c', 't', 'y', 'b', 'b', 'b', 'b'] for i in a: a.remove(b) # why can't i remove all the b from list a? a ['c', 't', 'y', 'b'] # this is the

[google-appengine] Re: is it a bug of python 2.5?----remove elements from list in for cycle

2009-06-01 Thread 风笑雪
a=[b,c,t,y,b,b,b,b] a=[i for i in a if i != 'b'] a ['c', 't', 'y'] a=[b,c,t,y,b,b,b,b] a = filter(lambda x: x != 'b', a) a ['c', 't', 'y'] 2009/6/1 秦锋 feng.w@gmail.com a = set(a) a.discard(b) a = list(a) On 6月1日, 下午8时48分, DiveIntoGAE taogf1...@gmail.com wrote:

[google-appengine] Re: is it a bug of python 2.5?----remove elements from list in for cycle

2009-06-01 Thread Luke Zhang
2009/6/1 秦锋 feng.w@gmail.com a = set(a) a.discard(b) a = list(a) ==I tried this, It works! -- Chunlei Zhang Ph.D. candidate Major: Curriculum Teaching Scholar Interests: science education; teacher training ; teacher knowledge; pck; concept map Biology Teaching