string python insert character code example
Example 1: how to add char to string python
def addChar(text,char,place):
return text[:place] + char + text[place:]
Example 2: insert into string python
>>> line = 'Kong Panda'
>>> index = line.find('Panda')
>>> output_line = line[:index] + 'Fu ' + line[index:]
>>> output_line
'Kong Fu Panda'