Insert Character at Start of String
To insert a character at start of string in Python, we can use String Concatenation Operator. Pass the specific character as left operand, and the string as right operand. The concatenation operator returns a new resulting string, with the character inserted at the start of the original string.
The syntax to insert character
ch at the starting of string
ch + x
In the following program, we take a string in x and character in ch, and prepend the character to the starting of the string.
x = 'apple' ch = 'm' output = ch + x print(output)
In this tutorial of Python Examples, we learned how to insert a character at the starting of string using String Concatenation Operator, with the help of well detailed examples.