I have a list of strings in Python - elements
. I would like to edit each element
in elements
. See the code below (it doesn't work, but you'll get the idea):
for element in elements:
element = "%" + element + "%"
Is there a way to do this?
elements = ['%{0}%'.format(element) for element in elements]