I have a list of 4 elements {a, b, c, d}
.
One of the elements has been assigned to a variable, say y
, at some point in the program.
I am looking for a command that will delete the element of the list that is the same as y
, BUT if two, three, or four of the elements are the same as y
, I only want to delete one of the elements that are the same.
For example, say y=2
and list={1, 2, 4, 6}
. I want the new list to be {1, 4, 6}
.
For another example, say y=5
and list={3, 5, 5, 5}
. I want the new list to be {3, 5, 5}
.
Drop[...]
$\endgroup$