Python Programming - Lists - Discussion

Discussion Forum : Lists - General Questions (Q.No. 67)
67.
How can you remove all occurrences of a specific element from a list in Python?
list.remove_all(element)
list.delete(element)
list.remove_all_occurrences(element)
list = [x for x in list if x != element]
Answer: Option
Explanation:
Using list comprehension, you can filter out all occurrences of a specific element.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.