<! hide How to concatenate Strings on Python <! endhide String concatenation is the process of adding two strings together in one. The easiest way to concatenate strings in Python would be to use the format string method. This method consists on adding the letter "f" before the string quote marks like this , then you can concatenate variables by calling them between brackets inside the string quote marks. Here is an example of how to use it: In the previous example, we are using the variable to concatenate it to the string. String concatenation is a common action we, as , have to deal with in almost any project. There are many ways you can concatenate strings, you can use any of them so pick the one that suits you the most. Concatenate strings on Python using the + operator The most familiar way to concatenate strings for most people is the operator. Check this example that explains how it works: Notice the space after and before , if we didn't added them, then the output would have looked like this: . Remember to add the spaces when needed. Concatenate strings using the += operator We can use the operator to concatenate strings as well, it's pretty similar to using the operator, but in this we will modify the value of the original string. Notice that there is a space inside the string, otherwise fullname's value would be "AlexSmith". Remember to add the spaces when needed. Concatenate an int or float value with text using str() Numbers and strings are data type completely different. When we want to add a number (int, float, etc) to a string, we will need to use the to convert that number into a string. As stated above, we are adding spaces for the render to respect writing rules. If we would not convert the number variable to a string , we would receive the following error letting you know you are trying to concatenate an Integer with a String. Concatenate strings on Python using the f Strings Python f Strings (formatted string literals) makes writing strings faster and much easier. This option was 3.6 so keep in mind backward compatibility when using it. This is one of the most used methods among experienced developers because of the ease to insert into the curly brackets . The variable(s) will be evaluated and a string representation will be displayed. Implementation: Making use of the concatenation, we don't need to convert numbers (Int, Float, etc) to string to be able to display them inside the curly brackets. Concatenate using .format() Another way to concatenate is by making use of the method. It works similar to since they both use curly brackets to insert variables but is available from version 2.7. This method doesn't need either to convert the number values into strings. As you can see, the result returned is the expected, but without spacing between words. Concatenate using % operator The operator is an older way to concatenate strings that work very similar to the method. We use as placeholders for different values, as we did with the curly brackets in previous examples. Concatenate using the Operator The use of the Operator is not a concatenation in the way we have been doing so far. The Operator is used for multiplication and that's exactly what it does, multiplying for the amount given the string. If you format the string variable correctly (leaving a space at the end of the sentence/word), this is the best way to repeat a line of text as many times as you may need. Recommended Material If you want to learn more about how to concatenate strings in Python and explore the different methods available, we invite you to check out this interactive tutorial . 👉 In this tutorial, you will learn: How to use modern and traditional methods to concatenate strings. The importance of handling different data types, such as numbers and strings. We will practice creating variables, loops, and some functions. Additionally, we will cover best practices for writing more readable and efficient code. Don’t miss it! This is an essential resource to become a more effective Python developer.