Python Concatenate Strings: Quick Guide & Examples

In Python, you can use the “+” operator or the join method on strings to concatenate multiple strings into one long string.

Option one: Use the “+” operator.

str1 = "Hello"
str2 = "World"
str3 = "!"
result = str1 + str2 + str3
print(result)

Option two: Utilize the join method of strings.

str_list = ["Hello", "World", "!"]
result = "".join(str_list)
print(result)

Both of the above methods can be used to concatenate multiple strings into one long string.

bannerAds