Here is a List:
list = ["Red", "Blue", "Green","Silver", "Yellow", "Gray","Green"]
I want to remove "Green" from the List. How it is possible?
python list
If your item is unique, which means the delete element is not repeated, you can use the remove() method in Python.
For Example:
list = ["Red", "Blue", "Green","Silver", "Yellow", "Gray","Green"]
list.remove("Green")
print(list)
Output:
['Red', 'Blue', 'Silver', 'Yellow', 'Gray', 'Green']
This means, using the remove() method in Python, it will remove only the first search item from the list