4.0 Python: String Concatenation
4.1 String Concatenation
To concatenate, or combine, two strings you can use the +
operator.
4.1.1 Example
Merge variable a
with variable b
into variable c
:
a = "Hello"
b = "World"
c = a + b
print(c)
4.1.2 Example
To add a space between them, add a " "
:
a = "Hello"
b = "World"
c = a + " " + b
print(c)