How to Append String in Python
In Python, the string object is immutable.
You can use + operator and join() to append string in python.
- Using + operator:
string_1 = "Python" string_2 = "Point" output = string_1 + string_2 print(output)
Output:
PythonPoint
- Using join()
string_1 = "Python" string_2 = "Point" output = "".join((string_1, string_2)) print(output)
Output:
PythonPoint
Subscribe
Login
Please login to comment
0 Discussion