Method # 1: Using List Slicing
This task can be accomplished using List Slicing. In doing so, we simply slice the list in two, splitting at the target position and then rejoining it after inserting the target substring in the middle.
The original string: geeksgeeks The add string: for The string after addition: pythonengineering
Method # 2: Using
join () + list () + insert ()
Another possible hack that can be done for the next problem is to convert the string to a list and append the string at a specific position and then do the join.
The original string: geeksgeeks The add string: for The string after performing addition: pythonengineering