I have a string list
items = ['B','D','B','A' ,'E']
Assume that I don't know the order (index) of these items. I would like to remove the second 'B' out of the list without sorting [using items.sort() ] or changing the the order of other items in the list. How can I do that?
The remove() and pop(), only take the first 'B' or I have to know the index of the second 'B' to remove second 'B' out.
items = ['B','D','B','A' ,'E']
Assume that I don't know the order (index) of these items. I would like to remove the second 'B' out of the list without sorting [using items.sort() ] or changing the the order of other items in the list. How can I do that?
The remove() and pop(), only take the first 'B' or I have to know the index of the second 'B' to remove second 'B' out.
Comment