The Secrets of Python You Didn't Know | String Concatenation
String concatenation is the process of merging two or more strings into one. While it may seem like a basic problem, in Python, there are multiple ways to achieve string concatenation. A poor choice can lead to performance issues. Method 1: Plus Operator Many languages support using the plus operator for string concatenation, and Python is no exception. Simply add two or more strings together to concatenate them. a = 'Python' b = 'Cuisine' r = a + b # Outputs 'PythonCuisine' Method 2: Using the % Operator Before Python 2.6, the % operator was the only way to format strings, and it can also be used for string concatenation. ...