python: whtat is the right way to remove element from list
google no found... I want two solutions:
1) How to remove an element in a for..in.. loop for a list?
2) How to remove all the elements in the list开发者_Go百科?
This is almost never what you want to do. Use a list comprehension to filter out the items you don't want.
del L[:]
1) filter()
2) list = []
精彩评论