Append character to end of string


Append character to end of string

To append a character to end of string in Python, we can use String Concatenation Operator. Pass the string as left operand, and the specific character as right operand. The concatenation operator returns a new resulting string, with the character appended to the original string.

string + character

Example

In the following program, we take a string in x and character in ch, and append the character to the end of the string.

Python Program

x = 'apple'
ch = 'm'
output = x + ch
print(output)

Output

applem

Summary

In this tutorial of Python Examples, we learned how to append a character to the end of string using String Concatenation Operator, with the help of well detailed examples.