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
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:
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