Python: Join String

By Xah Lee. Date: .

Adjacent Strings Automatically Joins

# adjacent string auto joins, as if with plus operator
# this feature is very old from the very beginning

x = "some" "thing"
print(x)
# "something"

The strings can be quoted in different ways, or with different prefix.

# adjacent strings auto joins
xx = "a" 'b' r"c" """some"""
print(xx)
# abcsome

Join String Operator

str1 + str2
xx = "aa" + "bb"
print(xx)
# "aabb"

Python, String