How to concatenate strings in Python ?

When you are working with strings in python, at some point in time, you would definitely need to join two strings to make a new string. Which has both strings combined. we call this as concatenation of strings.

If you are new to python, read our all python articles from python page.

This post shows how you can join two strings in python in very simple way using “plus” or + operator.

[bash] #!/usr/bin/env python string1 = "Hello, how are you ? …" string2 = "I am fine" final_string = string1 + string2 print (final_string) [/bash]

When you execute this program from console it will print the final string as combination of string1 and string2

$ python3 contactname.py 
Hello, how are you ? ...I am fine

Leave a Comment