Example append a character to string Python
Simple example code appends string to another string in Python. The Python string is an immutable object, so any methods that perform some action on a string return a new string.
Using + Operator
It concatenates two strings or a string and a character and returns a new string in Python.
s = "Hell" c = "o" print(s + c)
Using the join() Method
The string.join() method concatenates all the iterable object elements using the string as a separator between the elements.
s = "Hell" c = "o" res = "".join((s, c)) print(res)
Do comment if you have any doubts and suggestions no this Python append char topic.
Note: IDE: PyCharm 2021.1.3 (Community Edition)
All Python Examples are in Python 3, so Maybe its different from python 2 or upgraded versions.
Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology & like learning technical.