string-operations

Perform a string operation for every element in a Python list

Perform a string operation for every element in a Python list Question: 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 …

Total answers: 7