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 result after the for cycle>>> 
> a.remove("b")
> >>> a
>
> ['c', 't', 'y']        # i need to remove the last "b" a second time
>
>
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to