+ 1
How can I replace something in a string in a list only if the string contains it
https://code.sololearn.com/czE9FgOD7IZ5/#py I want to remove the commas and my txt file contains integers that some of them contain a comma
1 Antwort
+ 3
This should remove commas for you:
content = [element.replace(",", "") for element in content]