Replacing instances of a character in a string
Strings in python are immutable, so you cannot treat them as a list and assign to indices. Use .replace() instead: If you need to replace only certain semicolons, you’ll need to be more specific. You could use slicing to isolate the section of the string to replace in: That’ll replace all semi-colons in the first 10 characters of the … Read more