How to concatenate two strings in Python
In this post we will give you information about How to concatenate two strings in Python. Hear we will give you detail about How to concatenate two strings in PythonAnd how to use it also give you demo for it if it is necessary.
we are going to learn how to concatenate the two strings in Python.
Concatenation means the joining of two strings into a single string.
To concatenate the two strings into a single string, we can use the + operator in Python.
Here is an example:
a = "Hello "b = "Python"c = a + bprint(c)
Output:
Hello Python
We can also add a space between two strings like this:
a = "Hello"b = "Python"c = a +" "+ bprint(c);
Appending a string
To append a string to an existing string, we can use the += operator in Python.
Here is an example:
a = "Hello"a += " Python"print(a)
Output:
Hello Python
Hope this code and post will helped you for implement How to concatenate two strings in Python. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs