Isaac A Isaac A - 6 months ago 20
Python Question

If item in list does not contain "string", add a "string2" to the item?

In Python I have a list of this sort:

list = ["item.1", "sdfhkjdsffs/THIS-STRING", "fsdhfjsdhfsdf/THIS-STRING",
item4/THIS-STRING, item5]

How do I go about adding
"some string"
for each item in list that does not contain

result = [x if x.find("SOME-STRING")>=0 else x+"some string" for x in list]