Consider the following string,
a = """Dear Sir or Madam,
I am writting to you about the show. I was very disappointed after this show. I would like to have my money back. At first the show started at 10.15, and it should be at 19.30.
After your show I wanted to visit my friends, and because of it, I didn't do it.
"""
The string has to be edited based on the list of lists given below.
li = [[25, 33, 'writing'],
[87, 91, 'the'],
[134, 142, 'First'],
[184, 186, 'have started'],
[265, 271, "couldn't"]]
Here, individual list correspond to a single change in the string. The first element in the list is the starting index and the second element is the ending index of the string which has to be replaced by the third element of the list.
for example: a[25:33] gives writting which has to be replaced by writing, a[87:91] gives this which has to be replaced by the and similarly to all the other lists.
The expected output for the given example is:
"""Dear Sir or Madam,
I am writing to you about the show. I was very disappointed after the show. I would like to have my money back. First the show started at 10.15, and it should have started at 19.30.
After your show I wanted to visit my friends, and because of it, I couldn't do it.
"""