How to add a charater ot he string in Python code example
Example 1: how to change character in string python
>>> s = list("Hello zorld")
>>> s
['H', 'e', 'l', 'l', 'o', ' ', 'z', 'o', 'r', 'l', 'd']
>>> s[6] = 'W'
>>> s
['H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd']
>>> "".join(s)
'Hello World'
Example 2: how to add char to string python
def addChar(text,char,place):
return text[:place] + char + text[place:]
Example 3: python insert text at beginning of string
m = 1
n = 2
yourstring = ("L" * m) + yourstring + ("L" * n)