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.

#!/usr/bin/env python

string1 = "Hello, how are you ? ..."
string2 = "I am fine"

final_string = string1 + string2

print (final_string)

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

$ python3 
Hello, how are you ? ...I am fine
Warp Perspective OpenCV Python With... x
Warp Perspective OpenCV Python With Source Code | OpenCV Python Projects with Source Code

Leave a Comment

Sign up to our newsletter!

ADB Commands Android Android Applications Android Build system Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development, Debugging and Performance Tools Development and Build Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia NDK / Middleware / HAL Operating System Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web Design and Development Website Hosting Wordpress Yocto Embedded Linux