I have a list of elements lets say
images = ['fcs-apple-5.5.4','gcs-banana-0.6.4','tf-2', 'mvc-grape-3.4.2']
basically I want to delete the item that has a sub-string grape
, so I will pass grape as input
and look for the item matching grape
.
so I want to do a for loop and match and find the element and delete it.
I know how to match the element, but I do not know how to find the index and delete it because I still have to get the whole list item name.
End results I'm looking for
images = ['fcs-apple-5.5.4','gcs-banana-0.6.4','tf-2']