Basically I have a string like this:
"1,2,3 2,3,4 3,4,5 4,5,6 5,6,7 26,117,1212" and I want to split it by spaces and then replace every i-th element in each element. So if I replace every 2nd element with 0, then the result will be:
"1,0,3 2,0,4 3,0,5 4,0,6 5,0,7 26,0,1212" Should I just split it and then for each string element, split them inside a for loop, and then if I am at the specified index, then use the specified value, otherwise the element itself and then append this to the final string?
I thought there might be a much better/faster and shorter way to do the same thing in Python.