How to add commas at required positions in the given string in Python? In my case, the positions are not fixed.
Example: My requirement is to add the commas after 5th, 8th, 11th, 13th in an input string = "hello Python program"
My expected output would be: hello, Py,tho,n p,rogram
Is there any simplest way to achieve this in Python?
Actually I need to apply a comma on 590 positions in my file record and then process it.