in reply to removing an element without index

Throw a dice and use the number from the dice as index value. Use rand to avoid actually throwing a dice.

Or did you mean to remove a special element that can somehow be identified? If so, tell us how to identify the unwanted element. Also look up grep in the documentation.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)